agent-messenger 2.7.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +6 -0
- package/.oxfmtrc.json +13 -1
- package/.oxlintrc.json +10 -1
- package/README.md +1 -12
- package/dist/package.json +59 -58
- package/dist/src/platforms/channeltalk/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/client.js +2 -2
- package/dist/src/platforms/channeltalk/client.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/message.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/snapshot.d.ts +4 -2
- package/dist/src/platforms/channeltalk/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/snapshot.js +86 -31
- package/dist/src/platforms/channeltalk/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts +9 -23
- package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.js +109 -341
- package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts +1 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.js +4 -4
- package/dist/src/platforms/channeltalkbot/client.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js +4 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.d.ts +3 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/snapshot.js +110 -60
- package/dist/src/platforms/channeltalkbot/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.js +48 -34
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/whoami.js.map +1 -1
- package/dist/src/platforms/discord/token-extractor.d.ts +2 -10
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +38 -172
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/discordbot/client.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/snapshot.d.ts +2 -0
- package/dist/src/platforms/discordbot/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/commands/snapshot.js +46 -34
- package/dist/src/platforms/discordbot/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/instagram/cli.d.ts.map +1 -1
- package/dist/src/platforms/instagram/cli.js +1 -4
- package/dist/src/platforms/instagram/cli.js.map +1 -1
- package/dist/src/platforms/instagram/client.d.ts.map +1 -1
- package/dist/src/platforms/instagram/client.js +8 -7
- package/dist/src/platforms/instagram/client.js.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -1
- package/dist/src/platforms/instagram/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/chat.js.map +1 -1
- package/dist/src/platforms/instagram/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/message.js.map +1 -1
- package/dist/src/platforms/instagram/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/instagram/commands/shared.js.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/instagram/credential-manager.js +1 -1
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/instagram/ensure-auth.js.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.d.ts +7 -19
- package/dist/src/platforms/instagram/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/instagram/token-extractor.js +44 -270
- package/dist/src/platforms/instagram/token-extractor.js.map +1 -1
- package/dist/src/platforms/instagram/types.d.ts.map +1 -1
- package/dist/src/platforms/instagram/types.js +4 -2
- package/dist/src/platforms/instagram/types.js.map +1 -1
- package/dist/src/platforms/kakaotalk/auth/kakao-login.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js +18 -4
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js.map +1 -1
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/client.js +3 -3
- package/dist/src/platforms/kakaotalk/client.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/auth.js +15 -9
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/commands/shared.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/connection.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/crypto.js +1 -1
- package/dist/src/platforms/kakaotalk/protocol/crypto.js.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/protocol/session.js +1 -3
- package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -1
- package/dist/src/platforms/kakaotalk/token-extractor.js +5 -2
- package/dist/src/platforms/kakaotalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -1
- package/dist/src/platforms/kakaotalk/types.js +4 -2
- package/dist/src/platforms/kakaotalk/types.js.map +1 -1
- package/dist/src/platforms/line/cli.d.ts.map +1 -1
- package/dist/src/platforms/line/cli.js +1 -4
- package/dist/src/platforms/line/cli.js.map +1 -1
- package/dist/src/platforms/line/client.d.ts.map +1 -1
- package/dist/src/platforms/line/client.js +5 -13
- package/dist/src/platforms/line/client.js.map +1 -1
- package/dist/src/platforms/line/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/chat.js.map +1 -1
- package/dist/src/platforms/line/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/line/commands/message.js.map +1 -1
- package/dist/src/platforms/line/listener.js +1 -1
- package/dist/src/platforms/line/listener.js.map +1 -1
- package/dist/src/platforms/slack/cli.d.ts.map +1 -1
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/client-mappers.d.ts +14 -0
- package/dist/src/platforms/slack/client-mappers.d.ts.map +1 -0
- package/dist/src/platforms/slack/client-mappers.js +245 -0
- package/dist/src/platforms/slack/client-mappers.js.map +1 -0
- package/dist/src/platforms/slack/client.d.ts +0 -1
- package/dist/src/platforms/slack/client.d.ts.map +1 -1
- package/dist/src/platforms/slack/client.js +41 -455
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/channel.js.map +1 -1
- package/dist/src/platforms/slack/commands/emoji.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/emoji.js +1 -3
- package/dist/src/platforms/slack/commands/emoji.js.map +1 -1
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/message.js.map +1 -1
- package/dist/src/platforms/slack/commands/reminder.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/reminder.js.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.js +75 -55
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/user.js.map +1 -1
- package/dist/src/platforms/slack/commands/usergroup.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/usergroup.js.map +1 -1
- package/dist/src/platforms/slack/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/whoami.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts +2 -6
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +35 -229
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/slackbot/cli.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/cli.js +1 -1
- package/dist/src/platforms/slackbot/cli.js.map +1 -1
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js +1 -1
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +4 -1
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.js +44 -31
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/teams/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/teams/commands/whoami.js.map +1 -1
- package/dist/src/platforms/teams/token-extractor.d.ts +6 -18
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/teams/token-extractor.js +71 -324
- package/dist/src/platforms/teams/token-extractor.js.map +1 -1
- package/dist/src/platforms/telegram/cli.d.ts.map +1 -1
- package/dist/src/platforms/telegram/cli.js +1 -4
- package/dist/src/platforms/telegram/cli.js.map +1 -1
- package/dist/src/platforms/telegram/client.d.ts.map +1 -1
- package/dist/src/platforms/telegram/client.js.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/auth.js +1 -1
- package/dist/src/platforms/telegram/commands/auth.js.map +1 -1
- package/dist/src/platforms/telegram/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/chat.js.map +1 -1
- package/dist/src/platforms/telegram/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/telegram/commands/message.js.map +1 -1
- package/dist/src/platforms/telegram/commands/whoami.js +1 -1
- package/dist/src/platforms/telegram/commands/whoami.js.map +1 -1
- package/dist/src/platforms/telegram/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/telegram/credential-manager.js +6 -2
- package/dist/src/platforms/telegram/credential-manager.js.map +1 -1
- package/dist/src/platforms/telegram/my-telegram-org.js.map +1 -1
- package/dist/src/platforms/webex/cli.d.ts.map +1 -1
- package/dist/src/platforms/webex/cli.js +1 -4
- package/dist/src/platforms/webex/cli.js.map +1 -1
- package/dist/src/platforms/webex/client.d.ts.map +1 -1
- package/dist/src/platforms/webex/client.js +3 -7
- package/dist/src/platforms/webex/client.js.map +1 -1
- package/dist/src/platforms/webex/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/auth.js +1 -3
- package/dist/src/platforms/webex/commands/auth.js.map +1 -1
- package/dist/src/platforms/webex/commands/member.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/member.js +1 -3
- package/dist/src/platforms/webex/commands/member.js.map +1 -1
- package/dist/src/platforms/webex/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/message.js.map +1 -1
- package/dist/src/platforms/webex/commands/snapshot.d.ts +1 -0
- package/dist/src/platforms/webex/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/snapshot.js +14 -7
- package/dist/src/platforms/webex/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/webex/commands/space.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/space.js.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.d.ts.map +1 -1
- package/dist/src/platforms/webex/commands/whoami.js.map +1 -1
- package/dist/src/platforms/webex/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/webex/credential-manager.js.map +1 -1
- package/dist/src/platforms/webex/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/webex/ensure-auth.js +1 -3
- package/dist/src/platforms/webex/ensure-auth.js.map +1 -1
- package/dist/src/platforms/webex/index.d.ts +1 -1
- package/dist/src/platforms/webex/index.d.ts.map +1 -1
- package/dist/src/platforms/webex/index.js.map +1 -1
- package/dist/src/platforms/webex/markdown-to-html.js.map +1 -1
- package/dist/src/platforms/webex/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/webex/token-extractor.js +5 -14
- package/dist/src/platforms/webex/token-extractor.js.map +1 -1
- package/dist/src/platforms/wechatbot/client.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/client.js.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/wechatbot/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsapp/cli.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/cli.js +1 -4
- package/dist/src/platforms/whatsapp/cli.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/chat.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/chat.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsapp/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/commands/shared.js.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js +1 -1
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -1
- package/dist/src/platforms/whatsapp/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsapp/ensure-auth.js.map +1 -1
- package/dist/src/platforms/whatsappbot/client.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/client.js +2 -2
- package/dist/src/platforms/whatsappbot/client.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/auth.js +4 -1
- package/dist/src/platforms/whatsappbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/message.js.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/shared.d.ts.map +1 -1
- package/dist/src/platforms/whatsappbot/commands/shared.js.map +1 -1
- package/dist/src/shared/chromium/browsers.d.ts +7 -0
- package/dist/src/shared/chromium/browsers.d.ts.map +1 -0
- package/dist/src/shared/chromium/browsers.js +89 -0
- package/dist/src/shared/chromium/browsers.js.map +1 -0
- package/dist/src/shared/chromium/cookie-reader.d.ts +20 -0
- package/dist/src/shared/chromium/cookie-reader.d.ts.map +1 -0
- package/dist/src/shared/chromium/cookie-reader.js +99 -0
- package/dist/src/shared/chromium/cookie-reader.js.map +1 -0
- package/dist/src/shared/chromium/decryptor.d.ts +42 -0
- package/dist/src/shared/chromium/decryptor.d.ts.map +1 -0
- package/dist/src/shared/chromium/decryptor.js +205 -0
- package/dist/src/shared/chromium/decryptor.js.map +1 -0
- package/dist/src/shared/chromium/index.d.ts +6 -0
- package/dist/src/shared/chromium/index.d.ts.map +1 -0
- package/dist/src/shared/chromium/index.js +4 -0
- package/dist/src/shared/chromium/index.js.map +1 -0
- package/dist/src/shared/chromium/types.d.ts +11 -0
- package/dist/src/shared/chromium/types.d.ts.map +1 -0
- package/dist/src/shared/chromium/types.js +2 -0
- package/dist/src/shared/chromium/types.js.map +1 -0
- package/dist/src/shared/utils/derived-key-cache.d.ts +1 -1
- package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -1
- package/dist/src/shared/utils/linux-keyring.js +4 -1
- package/dist/src/shared/utils/linux-keyring.js.map +1 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.d.ts.map +1 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.js +6 -1
- package/dist/src/tui/adapters/kakaotalk-adapter.js.map +1 -1
- package/dist/src/tui/adapters/telegram-adapter.js +1 -1
- package/dist/src/tui/adapters/telegram-adapter.js.map +1 -1
- package/dist/src/tui/adapters/webex-adapter.js +1 -1
- package/dist/src/tui/adapters/webex-adapter.js.map +1 -1
- package/dist/src/tui/app.d.ts.map +1 -1
- package/dist/src/tui/app.js +112 -23
- package/dist/src/tui/app.js.map +1 -1
- package/dist/src/tui/utils.d.ts.map +1 -1
- package/dist/src/tui/utils.js +11 -13
- package/dist/src/tui/utils.js.map +1 -1
- package/dist/src/tui/views/channel-picker.d.ts.map +1 -1
- package/dist/src/tui/views/channel-picker.js.map +1 -1
- package/dist/src/tui/views/workspace-picker.d.ts.map +1 -1
- package/dist/src/tui/views/workspace-picker.js.map +1 -1
- package/docs/content/docs/agent-skills.mdx +0 -10
- package/docs/content/docs/cli/channeltalk.mdx +42 -30
- package/docs/content/docs/cli/channeltalkbot.mdx +23 -13
- package/docs/content/docs/cli/discord.mdx +23 -7
- package/docs/content/docs/cli/discordbot.mdx +23 -7
- package/docs/content/docs/cli/instagram.mdx +4 -4
- package/docs/content/docs/cli/kakaotalk.mdx +9 -8
- package/docs/content/docs/cli/line.mdx +14 -14
- package/docs/content/docs/cli/slack.mdx +24 -7
- package/docs/content/docs/cli/teams.mdx +24 -8
- package/docs/content/docs/cli/webex.mdx +34 -21
- package/docs/content/docs/cli/wechatbot.mdx +12 -11
- package/docs/content/docs/cli/whatsapp.mdx +5 -4
- package/docs/content/docs/cli/whatsappbot.mdx +11 -11
- package/docs/content/docs/index.mdx +7 -7
- package/docs/content/docs/meta.json +1 -9
- package/docs/content/docs/sdk/channeltalk.mdx +5 -6
- package/docs/content/docs/sdk/channeltalkbot.mdx +6 -12
- package/docs/content/docs/sdk/discord.mdx +36 -43
- package/docs/content/docs/sdk/instagram.mdx +18 -18
- package/docs/content/docs/sdk/kakaotalk.mdx +27 -18
- package/docs/content/docs/sdk/line.mdx +8 -13
- package/docs/content/docs/sdk/meta.json +14 -1
- package/docs/content/docs/sdk/slack.mdx +36 -42
- package/docs/content/docs/sdk/teams.mdx +2 -8
- package/docs/content/docs/sdk/webex.mdx +2 -12
- package/docs/content/docs/sdk/wechatbot.mdx +1 -5
- package/docs/content/docs/sdk/whatsapp.mdx +10 -19
- package/docs/content/docs/sdk/whatsappbot.mdx +2 -10
- package/docs/content/docs/tui.mdx +23 -23
- package/docs/src/app/page.tsx +353 -108
- package/e2e/channeltalkbot.e2e.test.ts +1 -5
- package/e2e/config.ts +6 -2
- package/package.json +59 -58
- package/scripts/prepublish.ts +1 -3
- package/skills/agent-channeltalk/SKILL.md +19 -9
- package/skills/agent-channeltalk/references/common-patterns.md +10 -9
- package/skills/agent-channeltalkbot/SKILL.md +19 -9
- package/skills/agent-channeltalkbot/references/common-patterns.md +10 -9
- package/skills/agent-discord/SKILL.md +18 -9
- package/skills/agent-discord/references/common-patterns.md +8 -7
- package/skills/agent-discordbot/SKILL.md +18 -9
- package/skills/agent-instagram/SKILL.md +1 -1
- package/skills/agent-kakaotalk/SKILL.md +1 -1
- package/skills/agent-line/SKILL.md +1 -1
- package/skills/agent-slack/SKILL.md +19 -10
- package/skills/agent-slack/references/common-patterns.md +4 -7
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-teams/SKILL.md +18 -9
- package/skills/agent-teams/references/common-patterns.md +9 -7
- package/skills/agent-telegram/SKILL.md +1 -1
- package/skills/agent-webex/SKILL.md +13 -4
- package/skills/agent-webex/references/common-patterns.md +8 -2
- package/skills/agent-wechatbot/SKILL.md +1 -1
- package/skills/agent-whatsapp/SKILL.md +1 -1
- package/skills/agent-whatsappbot/SKILL.md +1 -1
- package/src/platforms/channeltalk/client.test.ts +116 -29
- package/src/platforms/channeltalk/client.ts +26 -6
- package/src/platforms/channeltalk/commands/auth.test.ts +5 -5
- package/src/platforms/channeltalk/commands/auth.ts +19 -5
- package/src/platforms/channeltalk/commands/message.test.ts +2 -6
- package/src/platforms/channeltalk/commands/message.ts +5 -1
- package/src/platforms/channeltalk/commands/snapshot.test.ts +77 -30
- package/src/platforms/channeltalk/commands/snapshot.ts +112 -34
- package/src/platforms/channeltalk/ensure-auth.test.ts +20 -17
- package/src/platforms/channeltalk/ensure-auth.ts +6 -7
- package/src/platforms/channeltalk/index.ts +0 -1
- package/src/platforms/channeltalk/token-extractor.test.ts +33 -25
- package/src/platforms/channeltalk/token-extractor.ts +120 -372
- package/src/platforms/channeltalkbot/client.test.ts +1 -3
- package/src/platforms/channeltalkbot/client.ts +39 -13
- package/src/platforms/channeltalkbot/commands/auth.test.ts +3 -1
- package/src/platforms/channeltalkbot/commands/auth.ts +4 -1
- package/src/platforms/channeltalkbot/commands/bot.test.ts +13 -5
- package/src/platforms/channeltalkbot/commands/message.test.ts +12 -6
- package/src/platforms/channeltalkbot/commands/shared.ts +6 -2
- package/src/platforms/channeltalkbot/commands/snapshot.test.ts +43 -13
- package/src/platforms/channeltalkbot/commands/snapshot.ts +131 -64
- package/src/platforms/channeltalkbot/credential-manager.test.ts +1 -1
- package/src/platforms/channeltalkbot/index.test.ts +0 -2
- package/src/platforms/channeltalkbot/index.ts +0 -1
- package/src/platforms/discord/commands/auth.test.ts +6 -4
- package/src/platforms/discord/commands/auth.ts +14 -14
- package/src/platforms/discord/commands/snapshot.test.ts +1 -1
- package/src/platforms/discord/commands/snapshot.ts +58 -42
- package/src/platforms/discord/commands/whoami.test.ts +2 -4
- package/src/platforms/discord/commands/whoami.ts +2 -0
- package/src/platforms/discord/ensure-auth.test.ts +5 -3
- package/src/platforms/discord/index.ts +0 -1
- package/src/platforms/discord/listener.test.ts +7 -1
- package/src/platforms/discord/token-extractor.test.ts +18 -12
- package/src/platforms/discord/token-extractor.ts +46 -190
- package/src/platforms/discordbot/client.ts +1 -4
- package/src/platforms/discordbot/commands/auth.test.ts +3 -1
- package/src/platforms/discordbot/commands/channel.test.ts +3 -1
- package/src/platforms/discordbot/commands/message.test.ts +3 -1
- package/src/platforms/discordbot/commands/server.test.ts +3 -1
- package/src/platforms/discordbot/commands/snapshot.test.ts +43 -19
- package/src/platforms/discordbot/commands/snapshot.ts +54 -37
- package/src/platforms/discordbot/commands/thread.test.ts +3 -1
- package/src/platforms/discordbot/commands/user.test.ts +3 -1
- package/src/platforms/instagram/cli.ts +1 -4
- package/src/platforms/instagram/client.test.ts +3 -8
- package/src/platforms/instagram/client.ts +39 -34
- package/src/platforms/instagram/commands/auth.test.ts +13 -12
- package/src/platforms/instagram/commands/auth.ts +136 -71
- package/src/platforms/instagram/commands/chat.test.ts +21 -24
- package/src/platforms/instagram/commands/chat.ts +2 -0
- package/src/platforms/instagram/commands/message.test.ts +29 -24
- package/src/platforms/instagram/commands/message.ts +3 -4
- package/src/platforms/instagram/commands/shared.ts +2 -5
- package/src/platforms/instagram/commands/whoami.test.ts +4 -6
- package/src/platforms/instagram/credential-manager.ts +2 -6
- package/src/platforms/instagram/ensure-auth.test.ts +1 -4
- package/src/platforms/instagram/ensure-auth.ts +6 -3
- package/src/platforms/instagram/listener.test.ts +7 -3
- package/src/platforms/instagram/token-extractor.test.ts +4 -16
- package/src/platforms/instagram/token-extractor.ts +55 -309
- package/src/platforms/instagram/types.test.ts +2 -6
- package/src/platforms/instagram/types.ts +4 -2
- package/src/platforms/kakaotalk/auth/kakao-login.ts +30 -8
- package/src/platforms/kakaotalk/client.test.ts +37 -25
- package/src/platforms/kakaotalk/client.ts +23 -12
- package/src/platforms/kakaotalk/commands/auth.test.ts +6 -18
- package/src/platforms/kakaotalk/commands/auth.ts +101 -47
- package/src/platforms/kakaotalk/commands/chat.test.ts +8 -11
- package/src/platforms/kakaotalk/commands/message.test.ts +15 -24
- package/src/platforms/kakaotalk/commands/shared.ts +1 -0
- package/src/platforms/kakaotalk/commands/whoami.test.ts +6 -10
- package/src/platforms/kakaotalk/credential-manager.test.ts +1 -4
- package/src/platforms/kakaotalk/index.test.ts +1 -0
- package/src/platforms/kakaotalk/index.ts +0 -2
- package/src/platforms/kakaotalk/listener.test.ts +7 -1
- package/src/platforms/kakaotalk/protocol/connection.ts +4 -1
- package/src/platforms/kakaotalk/protocol/crypto.ts +1 -1
- package/src/platforms/kakaotalk/protocol/session.ts +12 -6
- package/src/platforms/kakaotalk/token-extractor.ts +5 -5
- package/src/platforms/kakaotalk/types.ts +8 -7
- package/src/platforms/line/cli.ts +1 -4
- package/src/platforms/line/client.ts +12 -20
- package/src/platforms/line/commands/auth.test.ts +2 -1
- package/src/platforms/line/commands/chat.test.ts +2 -1
- package/src/platforms/line/commands/chat.ts +1 -4
- package/src/platforms/line/commands/friend.test.ts +2 -1
- package/src/platforms/line/commands/message.test.ts +2 -1
- package/src/platforms/line/commands/message.ts +2 -9
- package/src/platforms/line/commands/whoami.test.ts +2 -1
- package/src/platforms/line/credential-manager.test.ts +1 -2
- package/src/platforms/line/index.test.ts +1 -0
- package/src/platforms/line/listener.ts +1 -1
- package/src/platforms/line/types.test.ts +1 -0
- package/src/platforms/slack/cli.ts +3 -1
- package/src/platforms/slack/client-mappers.ts +297 -0
- package/src/platforms/slack/client.test.ts +532 -17
- package/src/platforms/slack/client.ts +69 -458
- package/src/platforms/slack/commands/channel.ts +1 -4
- package/src/platforms/slack/commands/emoji.test.ts +6 -4
- package/src/platforms/slack/commands/emoji.ts +20 -22
- package/src/platforms/slack/commands/message.ts +6 -1
- package/src/platforms/slack/commands/pin.test.ts +14 -12
- package/src/platforms/slack/commands/reminder.ts +7 -6
- package/src/platforms/slack/commands/snapshot.test.ts +63 -8
- package/src/platforms/slack/commands/snapshot.ts +98 -66
- package/src/platforms/slack/commands/user.ts +6 -1
- package/src/platforms/slack/commands/usergroup.test.ts +3 -3
- package/src/platforms/slack/commands/usergroup.ts +10 -7
- package/src/platforms/slack/commands/whoami.test.ts +1 -1
- package/src/platforms/slack/commands/whoami.ts +2 -0
- package/src/platforms/slack/index.ts +0 -2
- package/src/platforms/slack/listener.test.ts +1 -0
- package/src/platforms/slack/token-extractor.test.ts +7 -12
- package/src/platforms/slack/token-extractor.ts +47 -255
- package/src/platforms/slackbot/cli.ts +8 -1
- package/src/platforms/slackbot/commands/auth.test.ts +3 -1
- package/src/platforms/teams/client.ts +1 -1
- package/src/platforms/teams/commands/auth.test.ts +1 -1
- package/src/platforms/teams/commands/auth.ts +4 -1
- package/src/platforms/teams/commands/snapshot.test.ts +1 -1
- package/src/platforms/teams/commands/snapshot.ts +53 -38
- package/src/platforms/teams/commands/whoami.test.ts +2 -4
- package/src/platforms/teams/commands/whoami.ts +2 -0
- package/src/platforms/teams/index.ts +0 -1
- package/src/platforms/teams/token-extractor.ts +82 -350
- package/src/platforms/telegram/app-config.test.ts +1 -0
- package/src/platforms/telegram/chat-utils.test.ts +5 -1
- package/src/platforms/telegram/cli.ts +2 -4
- package/src/platforms/telegram/client.test.ts +16 -3
- package/src/platforms/telegram/client.ts +14 -4
- package/src/platforms/telegram/commands/auth.test.ts +1 -0
- package/src/platforms/telegram/commands/auth.ts +3 -4
- package/src/platforms/telegram/commands/chat.test.ts +2 -5
- package/src/platforms/telegram/commands/chat.ts +1 -0
- package/src/platforms/telegram/commands/message.test.ts +2 -5
- package/src/platforms/telegram/commands/message.ts +1 -0
- package/src/platforms/telegram/commands/shared.test.ts +1 -0
- package/src/platforms/telegram/commands/whoami.test.ts +5 -7
- package/src/platforms/telegram/commands/whoami.ts +1 -1
- package/src/platforms/telegram/credential-manager.test.ts +1 -0
- package/src/platforms/telegram/credential-manager.ts +11 -2
- package/src/platforms/telegram/my-telegram-org.ts +6 -2
- package/src/platforms/telegram/types.test.ts +1 -0
- package/src/platforms/webex/app-config.test.ts +1 -0
- package/src/platforms/webex/cli.ts +1 -4
- package/src/platforms/webex/client.test.ts +4 -12
- package/src/platforms/webex/client.ts +14 -52
- package/src/platforms/webex/commands/auth.test.ts +7 -1
- package/src/platforms/webex/commands/auth.ts +12 -15
- package/src/platforms/webex/commands/member.test.ts +1 -3
- package/src/platforms/webex/commands/member.ts +14 -19
- package/src/platforms/webex/commands/message.ts +4 -15
- package/src/platforms/webex/commands/snapshot.test.ts +42 -4
- package/src/platforms/webex/commands/snapshot.ts +19 -11
- package/src/platforms/webex/commands/space.test.ts +3 -3
- package/src/platforms/webex/commands/space.ts +2 -9
- package/src/platforms/webex/commands/whoami.test.ts +12 -5
- package/src/platforms/webex/commands/whoami.ts +2 -0
- package/src/platforms/webex/credential-manager.ts +11 -2
- package/src/platforms/webex/ensure-auth.ts +1 -3
- package/src/platforms/webex/index.ts +1 -7
- package/src/platforms/webex/markdown-to-html.test.ts +6 -18
- package/src/platforms/webex/markdown-to-html.ts +8 -8
- package/src/platforms/webex/token-extractor.ts +6 -29
- package/src/platforms/wechatbot/client.test.ts +6 -2
- package/src/platforms/wechatbot/client.ts +6 -1
- package/src/platforms/wechatbot/commands/auth.test.ts +3 -7
- package/src/platforms/wechatbot/commands/message.test.ts +1 -4
- package/src/platforms/wechatbot/commands/message.ts +5 -1
- package/src/platforms/wechatbot/commands/template.test.ts +1 -4
- package/src/platforms/wechatbot/commands/user.test.ts +2 -7
- package/src/platforms/whatsapp/cli.ts +1 -4
- package/src/platforms/whatsapp/commands/auth.test.ts +19 -22
- package/src/platforms/whatsapp/commands/chat.test.ts +21 -24
- package/src/platforms/whatsapp/commands/chat.ts +2 -0
- package/src/platforms/whatsapp/commands/message.test.ts +22 -24
- package/src/platforms/whatsapp/commands/message.ts +3 -5
- package/src/platforms/whatsapp/commands/shared.ts +2 -5
- package/src/platforms/whatsapp/commands/whoami.test.ts +2 -2
- package/src/platforms/whatsapp/credential-manager.ts +2 -6
- package/src/platforms/whatsapp/ensure-auth.test.ts +1 -4
- package/src/platforms/whatsapp/ensure-auth.ts +14 -6
- package/src/platforms/whatsapp/index.ts +0 -2
- package/src/platforms/whatsappbot/client.test.ts +13 -7
- package/src/platforms/whatsappbot/client.ts +18 -4
- package/src/platforms/whatsappbot/commands/auth.ts +4 -1
- package/src/platforms/whatsappbot/commands/message.test.ts +12 -2
- package/src/platforms/whatsappbot/commands/message.ts +16 -3
- package/src/platforms/whatsappbot/commands/shared.ts +3 -1
- package/src/platforms/whatsappbot/commands/whoami.test.ts +1 -3
- package/src/platforms/whatsappbot/index.ts +0 -2
- package/src/shared/chromium/browsers.test.ts +274 -0
- package/src/shared/chromium/browsers.ts +86 -0
- package/src/shared/chromium/cookie-reader.test.ts +274 -0
- package/src/shared/chromium/cookie-reader.ts +111 -0
- package/src/shared/chromium/decryptor.test.ts +449 -0
- package/src/shared/chromium/decryptor.ts +227 -0
- package/src/shared/chromium/index.ts +11 -0
- package/src/shared/chromium/types.ts +11 -0
- package/src/shared/utils/derived-key-cache.ts +1 -1
- package/src/shared/utils/linux-keyring.ts +4 -4
- package/src/tui/adapters/kakaotalk-adapter.ts +6 -1
- package/src/tui/adapters/telegram-adapter.ts +1 -1
- package/src/tui/adapters/webex-adapter.ts +1 -1
- package/src/tui/app.ts +149 -59
- package/src/tui/utils.test.ts +144 -145
- package/src/tui/utils.ts +27 -29
- package/src/tui/views/channel-picker.ts +1 -1
- package/src/tui/views/workspace-picker.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Binary, Long } from 'bson'
|
|
2
2
|
|
|
3
3
|
import type { KakaoDeviceType } from '../types'
|
|
4
|
-
|
|
5
4
|
import {
|
|
6
5
|
BOOKING_HOST,
|
|
7
6
|
BOOKING_PORT,
|
|
@@ -25,7 +24,13 @@ export class LocoSession {
|
|
|
25
24
|
private closeHandler: (() => void) | null = null
|
|
26
25
|
private deviceType: KakaoDeviceType = 'tablet'
|
|
27
26
|
|
|
28
|
-
async login(
|
|
27
|
+
async login(
|
|
28
|
+
oauthToken: string,
|
|
29
|
+
userId: string,
|
|
30
|
+
deviceUuid: string,
|
|
31
|
+
syncState?: SyncState,
|
|
32
|
+
deviceType?: KakaoDeviceType,
|
|
33
|
+
): Promise<LoginListResponse> {
|
|
29
34
|
this.deviceType = deviceType ?? 'tablet'
|
|
30
35
|
const deviceConfig = getLocoDeviceConfig(this.deviceType)
|
|
31
36
|
|
|
@@ -43,9 +48,7 @@ export class LocoSession {
|
|
|
43
48
|
|
|
44
49
|
const chatIds = syncState?.chatIds.map((id) => new Long(id.low, id.high)) ?? []
|
|
45
50
|
const maxIds = syncState?.maxIds.map((id) => new Long(id.low, id.high)) ?? []
|
|
46
|
-
const lastTokenId = syncState
|
|
47
|
-
? new Long(syncState.lastTokenId.low, syncState.lastTokenId.high)
|
|
48
|
-
: Long.fromNumber(0)
|
|
51
|
+
const lastTokenId = syncState ? new Long(syncState.lastTokenId.low, syncState.lastTokenId.high) : Long.fromNumber(0)
|
|
49
52
|
const lbk = syncState?.lbk ?? 0
|
|
50
53
|
|
|
51
54
|
const response = await this.connection.sendPacket('LOGINLIST', {
|
|
@@ -71,7 +74,10 @@ export class LocoSession {
|
|
|
71
74
|
return response.body as unknown as LoginListResponse
|
|
72
75
|
}
|
|
73
76
|
|
|
74
|
-
private async bookAndCheckin(
|
|
77
|
+
private async bookAndCheckin(
|
|
78
|
+
userId: string,
|
|
79
|
+
deviceConfig: { os: string; appVersion: string; useSub: boolean },
|
|
80
|
+
): Promise<{ host: string; port: number }> {
|
|
75
81
|
const bookingConn = new LocoConnection()
|
|
76
82
|
await bookingConn.connectTls(BOOKING_HOST, BOOKING_PORT)
|
|
77
83
|
|
|
@@ -130,7 +130,7 @@ export class KakaoTokenExtractor {
|
|
|
130
130
|
// Extract oauth_token from talk-pilsner.kakao.com requests
|
|
131
131
|
// talk-pilsner.kakao.com has the real messaging oauth tokens.
|
|
132
132
|
// Other subdomains (bzm-capi, etc.) use different token types.
|
|
133
|
-
const talkRows = rows.filter(r => r.request_key.includes('talk-pilsner.kakao.com'))
|
|
133
|
+
const talkRows = rows.filter((r) => r.request_key.includes('talk-pilsner.kakao.com'))
|
|
134
134
|
let token: ExtractedKakaoToken | null = null
|
|
135
135
|
|
|
136
136
|
for (const row of talkRows) {
|
|
@@ -263,10 +263,10 @@ export class KakaoTokenExtractor {
|
|
|
263
263
|
|
|
264
264
|
private readWindowsRegistry(): { deviceUuid: string; deviceId: string } | null {
|
|
265
265
|
try {
|
|
266
|
-
const regOutput = execSync(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
)
|
|
266
|
+
const regOutput = execSync('reg query "HKCU\\Software\\Kakao\\KakaoTalk\\DeviceInfo" /s 2>nul', {
|
|
267
|
+
encoding: 'utf8',
|
|
268
|
+
timeout: 5000,
|
|
269
|
+
})
|
|
270
270
|
|
|
271
271
|
const uuidMatch = regOutput.match(/sys_uuid\s+REG_SZ\s+(.+)/i)
|
|
272
272
|
const deviceIdMatch = regOutput.match(/dev_id\s+REG_SZ\s+(.+)/i)
|
|
@@ -65,8 +65,7 @@ export const KAKAO_NEXT_ACTIONS: Record<string, { next_action: string; message:
|
|
|
65
65
|
},
|
|
66
66
|
choose_device: {
|
|
67
67
|
next_action: 'choose_device',
|
|
68
|
-
message:
|
|
69
|
-
'Tablet slot occupied. Provide --device-type pc or --device-type tablet with --force to replace.',
|
|
68
|
+
message: 'Tablet slot occupied. Provide --device-type pc or --device-type tablet with --force to replace.',
|
|
70
69
|
},
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -105,11 +104,13 @@ export const KakaoChatSchema = z.object({
|
|
|
105
104
|
display_name: z.string().nullable(),
|
|
106
105
|
active_members: z.number(),
|
|
107
106
|
unread_count: z.number(),
|
|
108
|
-
last_message: z
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
last_message: z
|
|
108
|
+
.object({
|
|
109
|
+
author_id: z.number(),
|
|
110
|
+
message: z.string(),
|
|
111
|
+
sent_at: z.number(),
|
|
112
|
+
})
|
|
113
|
+
.nullable(),
|
|
113
114
|
})
|
|
114
115
|
|
|
115
116
|
export const KakaoMessageSchema = z.object({
|
|
@@ -18,10 +18,7 @@ function isAuthCommand(command: CommandType): boolean {
|
|
|
18
18
|
|
|
19
19
|
const program = new Command()
|
|
20
20
|
|
|
21
|
-
program
|
|
22
|
-
.name('agent-line')
|
|
23
|
-
.description('CLI tool for LINE messaging')
|
|
24
|
-
.version(pkg.version)
|
|
21
|
+
program.name('agent-line').description('CLI tool for LINE messaging').version(pkg.version)
|
|
25
22
|
|
|
26
23
|
program.hook('preAction', async (_thisCommand, actionCommand) => {
|
|
27
24
|
if (isAuthCommand(actionCommand)) return
|
|
@@ -2,13 +2,13 @@ import { mkdirSync } from 'node:fs'
|
|
|
2
2
|
import { homedir } from 'node:os'
|
|
3
3
|
import { join } from 'node:path'
|
|
4
4
|
|
|
5
|
+
import { FileStorage } from '@/vendor/linejs/base/storage/mod.js'
|
|
5
6
|
import {
|
|
6
7
|
loginWithQR as linejsLoginWithQR,
|
|
7
8
|
loginWithPassword as linejsLoginWithPassword,
|
|
8
9
|
loginWithAuthToken as linejsLoginWithAuthToken,
|
|
9
10
|
type Client,
|
|
10
11
|
} from '@/vendor/linejs/client/mod.js'
|
|
11
|
-
import { FileStorage } from '@/vendor/linejs/base/storage/mod.js'
|
|
12
12
|
|
|
13
13
|
import { LineCredentialManager } from './credential-manager'
|
|
14
14
|
import type {
|
|
@@ -146,10 +146,7 @@ export class LineClient {
|
|
|
146
146
|
if (!creds) {
|
|
147
147
|
const account = await this.credManager.getAccount()
|
|
148
148
|
if (!account) {
|
|
149
|
-
throw new LineError(
|
|
150
|
-
'not_authenticated',
|
|
151
|
-
'No account found. Call loginWithQR() or loginWithEmail() first.',
|
|
152
|
-
)
|
|
149
|
+
throw new LineError('not_authenticated', 'No account found. Call loginWithQR() or loginWithEmail() first.')
|
|
153
150
|
}
|
|
154
151
|
creds = account
|
|
155
152
|
}
|
|
@@ -171,9 +168,7 @@ export class LineClient {
|
|
|
171
168
|
mid: profile.mid,
|
|
172
169
|
display_name: profile.displayName,
|
|
173
170
|
status_message: profile.statusMessage || undefined,
|
|
174
|
-
picture_url: profile.picturePath
|
|
175
|
-
? `https://profile.line-scdn.net${profile.picturePath}`
|
|
176
|
-
: undefined,
|
|
171
|
+
picture_url: profile.picturePath ? `https://profile.line-scdn.net${profile.picturePath}` : undefined,
|
|
177
172
|
}
|
|
178
173
|
} catch (error) {
|
|
179
174
|
throw wrapError(error, 'get_profile_failed')
|
|
@@ -191,9 +186,7 @@ export class LineClient {
|
|
|
191
186
|
mid: contact.mid,
|
|
192
187
|
display_name: contact.displayName,
|
|
193
188
|
status_message: contact.statusMessage || undefined,
|
|
194
|
-
picture_url: contact.picturePath
|
|
195
|
-
? `https://profile.line-scdn.net${contact.picturePath}`
|
|
196
|
-
: undefined,
|
|
189
|
+
picture_url: contact.picturePath ? `https://profile.line-scdn.net${contact.picturePath}` : undefined,
|
|
197
190
|
}))
|
|
198
191
|
} catch (error) {
|
|
199
192
|
throw wrapError(error, 'get_friends_failed')
|
|
@@ -232,14 +225,13 @@ export class LineClient {
|
|
|
232
225
|
}
|
|
233
226
|
|
|
234
227
|
const messageBoxes = boxes?.messageBoxes ?? []
|
|
235
|
-
const userMids = messageBoxes
|
|
236
|
-
|
|
237
|
-
.map((box) => box.id)
|
|
238
|
-
const groupMids = messageBoxes
|
|
239
|
-
.filter((box) => box.midType !== 'USER' && !seen.has(box.id))
|
|
240
|
-
.map((box) => box.id)
|
|
228
|
+
const userMids = messageBoxes.filter((box) => box.midType === 'USER' && !seen.has(box.id)).map((box) => box.id)
|
|
229
|
+
const groupMids = messageBoxes.filter((box) => box.midType !== 'USER' && !seen.has(box.id)).map((box) => box.id)
|
|
241
230
|
|
|
242
|
-
const nameMap = new Map<
|
|
231
|
+
const nameMap = new Map<
|
|
232
|
+
string,
|
|
233
|
+
{ name: string; type: 'user' | 'group' | 'room' | 'square'; memberCount?: number }
|
|
234
|
+
>()
|
|
243
235
|
|
|
244
236
|
if (userMids.length > 0) {
|
|
245
237
|
try {
|
|
@@ -270,7 +262,7 @@ export class LineClient {
|
|
|
270
262
|
const info = nameMap.get(box.id)
|
|
271
263
|
results.push({
|
|
272
264
|
chat_id: box.id,
|
|
273
|
-
type: info?.type ?? (box.midType === 'USER' ? 'user' as const : 'group' as const),
|
|
265
|
+
type: info?.type ?? (box.midType === 'USER' ? ('user' as const) : ('group' as const)),
|
|
274
266
|
display_name: info?.name ?? box.id,
|
|
275
267
|
member_count: info?.memberCount,
|
|
276
268
|
})
|
|
@@ -315,7 +307,7 @@ export class LineClient {
|
|
|
315
307
|
async sendMessage(chatId: string, text: string): Promise<LineSendResult> {
|
|
316
308
|
try {
|
|
317
309
|
const client = this.ensureClient()
|
|
318
|
-
let sent
|
|
310
|
+
let sent
|
|
319
311
|
|
|
320
312
|
try {
|
|
321
313
|
sent = await client.base.talk.sendMessage({ to: chatId, text, e2ee: true })
|
|
@@ -42,7 +42,8 @@ beforeEach(() => {
|
|
|
42
42
|
setCurrentAccountSpy = spyOn(LineCredentialManager.prototype, 'setCurrentAccount').mockResolvedValue(undefined)
|
|
43
43
|
removeAccountSpy = spyOn(LineCredentialManager.prototype, 'removeAccount').mockResolvedValue(undefined)
|
|
44
44
|
clearAllSpy = spyOn(LineCredentialManager.prototype, 'clearAll').mockResolvedValue(undefined)
|
|
45
|
-
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
45
|
+
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
46
|
+
console.log = consoleLogSpy
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
afterEach(() => {
|
|
@@ -37,7 +37,8 @@ beforeEach(() => {
|
|
|
37
37
|
])
|
|
38
38
|
|
|
39
39
|
closeSpy = spyOn(LineClient.prototype, 'close').mockImplementation(() => {})
|
|
40
|
-
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
40
|
+
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
41
|
+
console.log = consoleLogSpy
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
afterEach(() => {
|
|
@@ -5,10 +5,7 @@ import { formatOutput } from '@/shared/utils/output'
|
|
|
5
5
|
|
|
6
6
|
import { LineClient } from '../client'
|
|
7
7
|
|
|
8
|
-
async function listAction(options: {
|
|
9
|
-
limit?: string
|
|
10
|
-
pretty?: boolean
|
|
11
|
-
}): Promise<void> {
|
|
8
|
+
async function listAction(options: { limit?: string; pretty?: boolean }): Promise<void> {
|
|
12
9
|
let client: LineClient | undefined
|
|
13
10
|
try {
|
|
14
11
|
client = await new LineClient().login()
|
|
@@ -31,7 +31,8 @@ beforeEach(() => {
|
|
|
31
31
|
])
|
|
32
32
|
|
|
33
33
|
closeSpy = spyOn(LineClient.prototype, 'close').mockImplementation(() => {})
|
|
34
|
-
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
34
|
+
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
35
|
+
console.log = consoleLogSpy
|
|
35
36
|
})
|
|
36
37
|
|
|
37
38
|
afterEach(() => {
|
|
@@ -43,7 +43,8 @@ beforeEach(() => {
|
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
closeSpy = spyOn(LineClient.prototype, 'close').mockImplementation(() => {})
|
|
46
|
-
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
46
|
+
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
47
|
+
console.log = consoleLogSpy
|
|
47
48
|
})
|
|
48
49
|
|
|
49
50
|
afterEach(() => {
|
|
@@ -5,10 +5,7 @@ import { formatOutput } from '@/shared/utils/output'
|
|
|
5
5
|
|
|
6
6
|
import { LineClient } from '../client'
|
|
7
7
|
|
|
8
|
-
async function listAction(
|
|
9
|
-
chatId: string,
|
|
10
|
-
options: { count?: string; pretty?: boolean },
|
|
11
|
-
): Promise<void> {
|
|
8
|
+
async function listAction(chatId: string, options: { count?: string; pretty?: boolean }): Promise<void> {
|
|
12
9
|
let client: LineClient | undefined
|
|
13
10
|
try {
|
|
14
11
|
client = await new LineClient().login()
|
|
@@ -22,11 +19,7 @@ async function listAction(
|
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
async function sendAction(
|
|
26
|
-
chatId: string,
|
|
27
|
-
text: string,
|
|
28
|
-
options: { pretty?: boolean },
|
|
29
|
-
): Promise<void> {
|
|
22
|
+
async function sendAction(chatId: string, text: string, options: { pretty?: boolean }): Promise<void> {
|
|
30
23
|
let client: LineClient | undefined
|
|
31
24
|
try {
|
|
32
25
|
client = await new LineClient().login()
|
|
@@ -23,7 +23,8 @@ beforeEach(() => {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
closeSpy = spyOn(LineClient.prototype, 'close').mockImplementation(() => {})
|
|
26
|
-
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
26
|
+
consoleLogSpy = mock((..._args: unknown[]) => {})
|
|
27
|
+
console.log = consoleLogSpy
|
|
27
28
|
})
|
|
28
29
|
|
|
29
30
|
afterEach(() => {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
|
|
1
2
|
import { mkdir, rm, stat } from 'node:fs/promises'
|
|
2
3
|
import { tmpdir } from 'node:os'
|
|
3
4
|
import { join } from 'node:path'
|
|
4
5
|
|
|
5
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
|
|
6
|
-
|
|
7
6
|
import { LineCredentialManager } from './credential-manager'
|
|
8
7
|
import type { LineAccountCredentials } from './types'
|
|
9
8
|
|
|
@@ -72,7 +72,7 @@ export class LineListener {
|
|
|
72
72
|
try {
|
|
73
73
|
const toType = msg.raw.toType
|
|
74
74
|
const isGroupOrRoom = toType === 'GROUP' || toType === 'ROOM' || toType === 0 || toType === 1
|
|
75
|
-
const chatId = isGroupOrRoom ? msg.to.id :
|
|
75
|
+
const chatId = isGroupOrRoom ? msg.to.id : msg.isMyMessage ? msg.to.id : msg.from.id
|
|
76
76
|
|
|
77
77
|
const event: LinePushMessageEvent = {
|
|
78
78
|
type: 'message',
|
|
@@ -40,7 +40,9 @@ const program = new Command()
|
|
|
40
40
|
|
|
41
41
|
program
|
|
42
42
|
.name('agent-slack')
|
|
43
|
-
.description(
|
|
43
|
+
.description(
|
|
44
|
+
'CLI tool for Slack communication with token extraction from the desktop app or a supported Chromium browser',
|
|
45
|
+
)
|
|
44
46
|
.version(pkg.version)
|
|
45
47
|
.option('--workspace <id>', 'Use specific workspace')
|
|
46
48
|
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
SlackBookmark,
|
|
3
|
+
SlackChannel,
|
|
4
|
+
SlackDM,
|
|
5
|
+
SlackFile,
|
|
6
|
+
SlackMessage,
|
|
7
|
+
SlackPin,
|
|
8
|
+
SlackReminder,
|
|
9
|
+
SlackSavedItem,
|
|
10
|
+
SlackScheduledMessage,
|
|
11
|
+
SlackUser,
|
|
12
|
+
SlackUserProfile,
|
|
13
|
+
SlackUsergroup,
|
|
14
|
+
} from './types'
|
|
15
|
+
|
|
16
|
+
function toRecord(value: unknown): Record<string, unknown> {
|
|
17
|
+
return value && typeof value === 'object' ? (value as Record<string, unknown>) : {}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function toString(value: unknown, fallback = ''): string {
|
|
21
|
+
return typeof value === 'string' ? value : fallback
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function toNumber(value: unknown, fallback = 0): number {
|
|
25
|
+
return typeof value === 'number' ? value : fallback
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function toBoolean(value: unknown, fallback = false): boolean {
|
|
29
|
+
return typeof value === 'boolean' ? value : fallback
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function toStringArray(value: unknown): string[] {
|
|
33
|
+
return Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : []
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function toOptionalStringArray(value: unknown): string[] | undefined {
|
|
37
|
+
return Array.isArray(value) ? toStringArray(value) : undefined
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function mapChannel(channel: unknown, defaults?: Partial<Pick<SlackChannel, 'id' | 'name'>>): SlackChannel {
|
|
41
|
+
const record = toRecord(channel)
|
|
42
|
+
const topicRecord = record.topic ? toRecord(record.topic) : null
|
|
43
|
+
const purposeRecord = record.purpose ? toRecord(record.purpose) : null
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
id: toString(record.id, defaults?.id ?? ''),
|
|
47
|
+
name: toString(record.name, defaults?.name ?? ''),
|
|
48
|
+
is_private: toBoolean(record.is_private),
|
|
49
|
+
is_archived: toBoolean(record.is_archived),
|
|
50
|
+
created: toNumber(record.created),
|
|
51
|
+
creator: toString(record.creator),
|
|
52
|
+
topic: topicRecord
|
|
53
|
+
? {
|
|
54
|
+
value: toString(topicRecord.value),
|
|
55
|
+
creator: toString(topicRecord.creator),
|
|
56
|
+
last_set: toNumber(topicRecord.last_set),
|
|
57
|
+
}
|
|
58
|
+
: undefined,
|
|
59
|
+
purpose: purposeRecord
|
|
60
|
+
? {
|
|
61
|
+
value: toString(purposeRecord.value),
|
|
62
|
+
creator: toString(purposeRecord.creator),
|
|
63
|
+
last_set: toNumber(purposeRecord.last_set),
|
|
64
|
+
}
|
|
65
|
+
: undefined,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function mapDM(channel: unknown): SlackDM {
|
|
70
|
+
const record = toRecord(channel)
|
|
71
|
+
return {
|
|
72
|
+
id: toString(record.id),
|
|
73
|
+
user: toString(record.user, toString(record.name)),
|
|
74
|
+
is_mpim: toBoolean(record.is_mpim),
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function mapFile(
|
|
79
|
+
file: unknown,
|
|
80
|
+
defaults?: Partial<Pick<SlackFile, 'id' | 'name' | 'title' | 'url_private'>>,
|
|
81
|
+
): SlackFile {
|
|
82
|
+
const record = toRecord(file)
|
|
83
|
+
return {
|
|
84
|
+
id: toString(record.id, defaults?.id ?? ''),
|
|
85
|
+
name: toString(record.name, defaults?.name ?? ''),
|
|
86
|
+
title: toString(record.title, defaults?.title ?? toString(record.name, defaults?.name ?? '')),
|
|
87
|
+
mimetype: toString(record.mimetype, 'application/octet-stream'),
|
|
88
|
+
size: toNumber(record.size),
|
|
89
|
+
url_private: toString(record.url_private, defaults?.url_private ?? ''),
|
|
90
|
+
created: toNumber(record.created),
|
|
91
|
+
user: toString(record.user),
|
|
92
|
+
channels: toOptionalStringArray(record.channels),
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function mapEdited(edited: unknown): SlackMessage['edited'] {
|
|
97
|
+
const record = toRecord(edited)
|
|
98
|
+
return {
|
|
99
|
+
user: toString(record.user),
|
|
100
|
+
ts: toString(record.ts),
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function mapReplies(replies: unknown): SlackMessage['replies'] {
|
|
105
|
+
if (!Array.isArray(replies)) return undefined
|
|
106
|
+
return replies.map((reply) => {
|
|
107
|
+
const record = toRecord(reply)
|
|
108
|
+
return {
|
|
109
|
+
user: toString(record.user),
|
|
110
|
+
ts: toString(record.ts),
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function mapReactions(reactions: unknown): SlackMessage['reactions'] {
|
|
116
|
+
if (!Array.isArray(reactions)) return undefined
|
|
117
|
+
return reactions.map((reaction) => {
|
|
118
|
+
const record = toRecord(reaction)
|
|
119
|
+
return {
|
|
120
|
+
name: toString(record.name),
|
|
121
|
+
count: toNumber(record.count),
|
|
122
|
+
users: toStringArray(record.users),
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function mapMessage(
|
|
128
|
+
message: unknown,
|
|
129
|
+
defaults?: Partial<Pick<SlackMessage, 'ts' | 'text' | 'type'>>,
|
|
130
|
+
): SlackMessage {
|
|
131
|
+
const record = toRecord(message)
|
|
132
|
+
const files = Array.isArray(record.files) ? record.files.map((file) => mapFile(file)) : undefined
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
ts: toString(record.ts, defaults?.ts ?? ''),
|
|
136
|
+
text: toString(record.text, defaults?.text ?? ''),
|
|
137
|
+
type: toString(record.type, defaults?.type ?? 'message'),
|
|
138
|
+
user: typeof record.user === 'string' ? record.user : undefined,
|
|
139
|
+
username: typeof record.username === 'string' ? record.username : undefined,
|
|
140
|
+
thread_ts: typeof record.thread_ts === 'string' ? record.thread_ts : undefined,
|
|
141
|
+
reply_count: typeof record.reply_count === 'number' ? record.reply_count : undefined,
|
|
142
|
+
replies: mapReplies(record.replies),
|
|
143
|
+
edited: record.edited ? mapEdited(record.edited) : undefined,
|
|
144
|
+
reactions: mapReactions(record.reactions),
|
|
145
|
+
files,
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function mapUser(user: unknown): SlackUser {
|
|
150
|
+
const record = toRecord(user)
|
|
151
|
+
const profileRecord = record.profile ? toRecord(record.profile) : null
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
id: toString(record.id),
|
|
155
|
+
name: toString(record.name),
|
|
156
|
+
real_name: toString(record.real_name, toString(record.name)),
|
|
157
|
+
is_admin: toBoolean(record.is_admin),
|
|
158
|
+
is_owner: toBoolean(record.is_owner),
|
|
159
|
+
is_bot: toBoolean(record.is_bot),
|
|
160
|
+
is_app_user: toBoolean(record.is_app_user),
|
|
161
|
+
profile: profileRecord
|
|
162
|
+
? {
|
|
163
|
+
email: typeof profileRecord.email === 'string' ? profileRecord.email : undefined,
|
|
164
|
+
phone: typeof profileRecord.phone === 'string' ? profileRecord.phone : undefined,
|
|
165
|
+
title: typeof profileRecord.title === 'string' ? profileRecord.title : undefined,
|
|
166
|
+
status_text: typeof profileRecord.status_text === 'string' ? profileRecord.status_text : undefined,
|
|
167
|
+
}
|
|
168
|
+
: undefined,
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function mapUserProfile(profile: unknown): SlackUserProfile {
|
|
173
|
+
const record = toRecord(profile)
|
|
174
|
+
return {
|
|
175
|
+
title: typeof record.title === 'string' ? record.title : undefined,
|
|
176
|
+
phone: typeof record.phone === 'string' ? record.phone : undefined,
|
|
177
|
+
skype: typeof record.skype === 'string' ? record.skype : undefined,
|
|
178
|
+
real_name: typeof record.real_name === 'string' ? record.real_name : undefined,
|
|
179
|
+
real_name_normalized: typeof record.real_name_normalized === 'string' ? record.real_name_normalized : undefined,
|
|
180
|
+
display_name: typeof record.display_name === 'string' ? record.display_name : undefined,
|
|
181
|
+
display_name_normalized:
|
|
182
|
+
typeof record.display_name_normalized === 'string' ? record.display_name_normalized : undefined,
|
|
183
|
+
status_text: typeof record.status_text === 'string' ? record.status_text : undefined,
|
|
184
|
+
status_emoji: typeof record.status_emoji === 'string' ? record.status_emoji : undefined,
|
|
185
|
+
status_expiration: typeof record.status_expiration === 'number' ? record.status_expiration : undefined,
|
|
186
|
+
email: typeof record.email === 'string' ? record.email : undefined,
|
|
187
|
+
first_name: typeof record.first_name === 'string' ? record.first_name : undefined,
|
|
188
|
+
last_name: typeof record.last_name === 'string' ? record.last_name : undefined,
|
|
189
|
+
image_24: typeof record.image_24 === 'string' ? record.image_24 : undefined,
|
|
190
|
+
image_32: typeof record.image_32 === 'string' ? record.image_32 : undefined,
|
|
191
|
+
image_48: typeof record.image_48 === 'string' ? record.image_48 : undefined,
|
|
192
|
+
image_72: typeof record.image_72 === 'string' ? record.image_72 : undefined,
|
|
193
|
+
image_192: typeof record.image_192 === 'string' ? record.image_192 : undefined,
|
|
194
|
+
image_512: typeof record.image_512 === 'string' ? record.image_512 : undefined,
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export function mapSavedItem(item: unknown): SlackSavedItem {
|
|
199
|
+
const record = toRecord(item)
|
|
200
|
+
const channelRecord = toRecord(record.channel)
|
|
201
|
+
return {
|
|
202
|
+
type: toString(record.type, 'message'),
|
|
203
|
+
message: mapMessage(record.message),
|
|
204
|
+
channel: {
|
|
205
|
+
id: toString(channelRecord.id),
|
|
206
|
+
name: toString(channelRecord.name),
|
|
207
|
+
},
|
|
208
|
+
date_created: toNumber(record.date_created),
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function mapPin(item: unknown, channel: string): SlackPin {
|
|
213
|
+
const record = toRecord(item)
|
|
214
|
+
return {
|
|
215
|
+
channel,
|
|
216
|
+
message: mapMessage(record.message),
|
|
217
|
+
date_created: toNumber(record.created),
|
|
218
|
+
created_by: toString(record.created_by),
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export function mapBookmark(
|
|
223
|
+
bookmark: unknown,
|
|
224
|
+
defaults?: Partial<Pick<SlackBookmark, 'id' | 'channel_id' | 'title' | 'link' | 'type'>>,
|
|
225
|
+
): SlackBookmark {
|
|
226
|
+
const record = toRecord(bookmark)
|
|
227
|
+
return {
|
|
228
|
+
id: toString(record.id, defaults?.id ?? ''),
|
|
229
|
+
channel_id: toString(record.channel_id, defaults?.channel_id ?? ''),
|
|
230
|
+
title: toString(record.title, defaults?.title ?? ''),
|
|
231
|
+
link: toString(record.link, defaults?.link ?? ''),
|
|
232
|
+
emoji: typeof record.emoji === 'string' ? record.emoji : undefined,
|
|
233
|
+
icon_url: typeof record.icon_url === 'string' ? record.icon_url : undefined,
|
|
234
|
+
type: toString(record.type, defaults?.type ?? 'link'),
|
|
235
|
+
date_created: toNumber(record.date_created),
|
|
236
|
+
date_updated: toNumber(record.date_updated),
|
|
237
|
+
created_by: toString(record.created_by),
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export function mapScheduledMessage(
|
|
242
|
+
message: unknown,
|
|
243
|
+
defaults?: Partial<Pick<SlackScheduledMessage, 'channel_id' | 'post_at' | 'date_created' | 'text'>>,
|
|
244
|
+
): SlackScheduledMessage {
|
|
245
|
+
const record = toRecord(message)
|
|
246
|
+
return {
|
|
247
|
+
id: toString(record.id, toString(record.scheduled_message_id)),
|
|
248
|
+
channel_id: toString(record.channel_id, defaults?.channel_id ?? ''),
|
|
249
|
+
post_at: toNumber(record.post_at, defaults?.post_at ?? 0),
|
|
250
|
+
date_created: toNumber(record.date_created, defaults?.date_created ?? 0),
|
|
251
|
+
text: toString(record.text, defaults?.text ?? ''),
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function mapReminder(
|
|
256
|
+
reminder: unknown,
|
|
257
|
+
defaults?: Partial<Pick<SlackReminder, 'text' | 'time'>>,
|
|
258
|
+
): SlackReminder {
|
|
259
|
+
const record = toRecord(reminder)
|
|
260
|
+
return {
|
|
261
|
+
id: toString(record.id),
|
|
262
|
+
creator: toString(record.creator),
|
|
263
|
+
text: toString(record.text, defaults?.text ?? ''),
|
|
264
|
+
user: toString(record.user),
|
|
265
|
+
recurring: toBoolean(record.recurring),
|
|
266
|
+
time: toNumber(record.time, defaults?.time ?? 0),
|
|
267
|
+
complete_ts: toNumber(record.complete_ts),
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function mapUsergroup(usergroup: unknown): SlackUsergroup {
|
|
272
|
+
const record = toRecord(usergroup)
|
|
273
|
+
const prefs = toRecord(record.prefs)
|
|
274
|
+
|
|
275
|
+
return {
|
|
276
|
+
id: toString(record.id),
|
|
277
|
+
team_id: toString(record.team_id),
|
|
278
|
+
name: toString(record.name),
|
|
279
|
+
handle: toString(record.handle),
|
|
280
|
+
description: toString(record.description),
|
|
281
|
+
is_external: toBoolean(record.is_external),
|
|
282
|
+
is_usergroup: toBoolean(record.is_usergroup),
|
|
283
|
+
date_create: toNumber(record.date_create),
|
|
284
|
+
date_update: toNumber(record.date_update),
|
|
285
|
+
date_delete: toNumber(record.date_delete),
|
|
286
|
+
auto_type: typeof record.auto_type === 'string' ? record.auto_type : null,
|
|
287
|
+
created_by: toString(record.created_by),
|
|
288
|
+
updated_by: toString(record.updated_by),
|
|
289
|
+
deleted_by: typeof record.deleted_by === 'string' ? record.deleted_by : null,
|
|
290
|
+
prefs: {
|
|
291
|
+
channels: toStringArray(prefs.channels),
|
|
292
|
+
groups: toStringArray(prefs.groups),
|
|
293
|
+
},
|
|
294
|
+
users: toStringArray(record.users),
|
|
295
|
+
user_count: toNumber(record.user_count),
|
|
296
|
+
}
|
|
297
|
+
}
|