agent-messenger 1.14.0 → 2.0.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/README.md +94 -13
- package/.claude-plugin/marketplace.json +51 -12
- package/.claude-plugin/plugin.json +14 -3
- package/CONTRIBUTING.md +49 -3
- package/README.md +211 -54
- package/bun.lock +350 -2
- package/cubic.yaml +69 -0
- package/dist/package.json +118 -9
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +27 -6
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/channeltalk/client.d.ts +5 -1
- package/dist/src/platforms/channeltalk/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/client.js +23 -6
- package/dist/src/platforms/channeltalk/client.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/commands/auth.js +4 -4
- package/dist/src/platforms/channeltalk/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/commands/shared.js +1 -1
- package/dist/src/platforms/channeltalk/commands/shared.js.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.d.ts +2 -2
- package/dist/src/platforms/channeltalk/ensure-auth.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/ensure-auth.js +4 -4
- package/dist/src/platforms/channeltalk/ensure-auth.js.map +1 -1
- package/dist/src/platforms/channeltalk/index.d.ts +2 -2
- package/dist/src/platforms/channeltalk/index.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/index.js +1 -2
- package/dist/src/platforms/channeltalk/index.js.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.d.ts +8 -0
- package/dist/src/platforms/channeltalk/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/token-extractor.js +127 -13
- package/dist/src/platforms/channeltalk/token-extractor.js.map +1 -1
- package/dist/src/platforms/channeltalk/types.d.ts +52 -949
- package/dist/src/platforms/channeltalk/types.d.ts.map +1 -1
- package/dist/src/platforms/channeltalk/types.js +1 -1
- package/dist/src/platforms/channeltalk/types.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts +5 -1
- package/dist/src/platforms/channeltalkbot/client.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/client.js +24 -9
- package/dist/src/platforms/channeltalkbot/client.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/auth.js +2 -2
- package/dist/src/platforms/channeltalkbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.js +1 -1
- package/dist/src/platforms/channeltalkbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/index.d.ts +2 -1
- package/dist/src/platforms/channeltalkbot/index.d.ts.map +1 -1
- package/dist/src/platforms/channeltalkbot/index.js.map +1 -1
- package/dist/src/platforms/channeltalkbot/types.d.ts +24 -186
- package/dist/src/platforms/channeltalkbot/types.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.d.ts +7 -1
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +27 -6
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +2 -2
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/commands/channel.js +3 -3
- package/dist/src/platforms/discord/commands/channel.js.map +1 -1
- package/dist/src/platforms/discord/commands/dm.js +2 -2
- package/dist/src/platforms/discord/commands/dm.js.map +1 -1
- package/dist/src/platforms/discord/commands/file.js +3 -3
- package/dist/src/platforms/discord/commands/file.js.map +1 -1
- package/dist/src/platforms/discord/commands/friend.js +1 -1
- package/dist/src/platforms/discord/commands/friend.js.map +1 -1
- package/dist/src/platforms/discord/commands/member.js +1 -1
- package/dist/src/platforms/discord/commands/member.js.map +1 -1
- package/dist/src/platforms/discord/commands/mention.js +1 -1
- package/dist/src/platforms/discord/commands/mention.js.map +1 -1
- package/dist/src/platforms/discord/commands/message.js +6 -6
- package/dist/src/platforms/discord/commands/message.js.map +1 -1
- package/dist/src/platforms/discord/commands/note.js +2 -2
- package/dist/src/platforms/discord/commands/note.js.map +1 -1
- package/dist/src/platforms/discord/commands/profile.js +1 -1
- package/dist/src/platforms/discord/commands/profile.js.map +1 -1
- package/dist/src/platforms/discord/commands/reaction.js +3 -3
- package/dist/src/platforms/discord/commands/reaction.js.map +1 -1
- package/dist/src/platforms/discord/commands/server.js +1 -1
- package/dist/src/platforms/discord/commands/server.js.map +1 -1
- package/dist/src/platforms/discord/commands/snapshot.js +1 -1
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/thread.js +2 -2
- package/dist/src/platforms/discord/commands/thread.js.map +1 -1
- package/dist/src/platforms/discord/commands/user.js +3 -3
- package/dist/src/platforms/discord/commands/user.js.map +1 -1
- package/dist/src/platforms/discord/ensure-auth.js +1 -1
- package/dist/src/platforms/discord/ensure-auth.js.map +1 -1
- package/dist/src/platforms/discord/index.d.ts +6 -0
- package/dist/src/platforms/discord/index.d.ts.map +1 -0
- package/dist/src/platforms/discord/index.js +5 -0
- package/dist/src/platforms/discord/index.js.map +1 -0
- package/dist/src/platforms/discord/listener.d.ts +41 -0
- package/dist/src/platforms/discord/listener.d.ts.map +1 -0
- package/dist/src/platforms/discord/listener.js +262 -0
- package/dist/src/platforms/discord/listener.js.map +1 -0
- package/dist/src/platforms/discord/types.d.ts +150 -352
- package/dist/src/platforms/discord/types.d.ts.map +1 -1
- package/dist/src/platforms/discord/types.js +28 -0
- package/dist/src/platforms/discord/types.js.map +1 -1
- package/dist/src/platforms/discordbot/client.d.ts +4 -1
- package/dist/src/platforms/discordbot/client.d.ts.map +1 -1
- package/dist/src/platforms/discordbot/client.js +23 -7
- package/dist/src/platforms/discordbot/client.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/auth.js +2 -2
- package/dist/src/platforms/discordbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/discordbot/commands/shared.js +1 -1
- package/dist/src/platforms/discordbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/discordbot/types.d.ts +15 -203
- package/dist/src/platforms/discordbot/types.d.ts.map +1 -1
- package/dist/src/platforms/instagram/cli.d.ts +5 -0
- package/dist/src/platforms/instagram/cli.d.ts.map +1 -0
- package/dist/src/platforms/instagram/cli.js +30 -0
- package/dist/src/platforms/instagram/cli.js.map +1 -0
- package/dist/src/platforms/instagram/client.d.ts +65 -0
- package/dist/src/platforms/instagram/client.d.ts.map +1 -0
- package/dist/src/platforms/instagram/client.js +524 -0
- package/dist/src/platforms/instagram/client.js.map +1 -0
- package/dist/src/platforms/instagram/commands/auth.d.ts +3 -0
- package/dist/src/platforms/instagram/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/auth.js +330 -0
- package/dist/src/platforms/instagram/commands/auth.js.map +1 -0
- package/dist/src/platforms/instagram/commands/chat.d.ts +3 -0
- package/dist/src/platforms/instagram/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/chat.js +42 -0
- package/dist/src/platforms/instagram/commands/chat.js.map +1 -0
- package/dist/src/platforms/instagram/commands/index.d.ts +4 -0
- package/dist/src/platforms/instagram/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/index.js +4 -0
- package/dist/src/platforms/instagram/commands/index.js.map +1 -0
- package/dist/src/platforms/instagram/commands/message.d.ts +3 -0
- package/dist/src/platforms/instagram/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/message.js +102 -0
- package/dist/src/platforms/instagram/commands/message.js.map +1 -0
- package/dist/src/platforms/instagram/commands/shared.d.ts +8 -0
- package/dist/src/platforms/instagram/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/instagram/commands/shared.js +31 -0
- package/dist/src/platforms/instagram/commands/shared.js.map +1 -0
- package/dist/src/platforms/instagram/credential-manager.d.ts +20 -0
- package/dist/src/platforms/instagram/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/instagram/credential-manager.js +104 -0
- package/dist/src/platforms/instagram/credential-manager.js.map +1 -0
- package/dist/src/platforms/instagram/ensure-auth.d.ts +2 -0
- package/dist/src/platforms/instagram/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/instagram/ensure-auth.js +21 -0
- package/dist/src/platforms/instagram/ensure-auth.js.map +1 -0
- package/dist/src/platforms/instagram/index.d.ts +5 -0
- package/dist/src/platforms/instagram/index.d.ts.map +1 -0
- package/dist/src/platforms/instagram/index.js +5 -0
- package/dist/src/platforms/instagram/index.js.map +1 -0
- package/dist/src/platforms/instagram/listener.d.ts +32 -0
- package/dist/src/platforms/instagram/listener.d.ts.map +1 -0
- package/dist/src/platforms/instagram/listener.js +87 -0
- package/dist/src/platforms/instagram/listener.js.map +1 -0
- package/dist/src/platforms/instagram/types.d.ts +61 -0
- package/dist/src/platforms/instagram/types.d.ts.map +1 -0
- package/dist/src/platforms/instagram/types.js +89 -0
- package/dist/src/platforms/instagram/types.js.map +1 -0
- package/dist/src/platforms/kakaotalk/auth/kakao-login.d.ts +27 -0
- package/dist/src/platforms/kakaotalk/auth/kakao-login.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js +213 -0
- package/dist/src/platforms/kakaotalk/auth/kakao-login.js.map +1 -0
- package/dist/src/platforms/kakaotalk/cli.d.ts +5 -0
- package/dist/src/platforms/kakaotalk/cli.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/cli.js +30 -0
- package/dist/src/platforms/kakaotalk/cli.js.map +1 -0
- package/dist/src/platforms/kakaotalk/client.d.ts +40 -0
- package/dist/src/platforms/kakaotalk/client.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/client.js +290 -0
- package/dist/src/platforms/kakaotalk/client.js.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/auth.js +515 -0
- package/dist/src/platforms/kakaotalk/commands/auth.js.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/chat.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/chat.js +23 -0
- package/dist/src/platforms/kakaotalk/commands/chat.js.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.d.ts +4 -0
- package/dist/src/platforms/kakaotalk/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/index.js +4 -0
- package/dist/src/platforms/kakaotalk/commands/index.js.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/message.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/message.js +41 -0
- package/dist/src/platforms/kakaotalk/commands/message.js.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/shared.d.ts +7 -0
- package/dist/src/platforms/kakaotalk/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/commands/shared.js +24 -0
- package/dist/src/platforms/kakaotalk/commands/shared.js.map +1 -0
- package/dist/src/platforms/kakaotalk/credential-manager.d.ts +27 -0
- package/dist/src/platforms/kakaotalk/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/credential-manager.js +82 -0
- package/dist/src/platforms/kakaotalk/credential-manager.js.map +1 -0
- package/dist/src/platforms/kakaotalk/ensure-auth.d.ts +3 -0
- package/dist/src/platforms/kakaotalk/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/ensure-auth.js +11 -0
- package/dist/src/platforms/kakaotalk/ensure-auth.js.map +1 -0
- package/dist/src/platforms/kakaotalk/index.d.ts +7 -0
- package/dist/src/platforms/kakaotalk/index.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/index.js +5 -0
- package/dist/src/platforms/kakaotalk/index.js.map +1 -0
- package/dist/src/platforms/kakaotalk/listener.d.ts +24 -0
- package/dist/src/platforms/kakaotalk/listener.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/listener.js +171 -0
- package/dist/src/platforms/kakaotalk/listener.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/config.d.ts +14 -0
- package/dist/src/platforms/kakaotalk/protocol/config.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/config.js +23 -0
- package/dist/src/platforms/kakaotalk/protocol/config.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/connection.d.ts +25 -0
- package/dist/src/platforms/kakaotalk/protocol/connection.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/connection.js +144 -0
- package/dist/src/platforms/kakaotalk/protocol/connection.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/crypto.d.ts +8 -0
- package/dist/src/platforms/kakaotalk/protocol/crypto.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/crypto.js +51 -0
- package/dist/src/platforms/kakaotalk/protocol/crypto.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/packet.d.ts +7 -0
- package/dist/src/platforms/kakaotalk/protocol/packet.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/packet.js +38 -0
- package/dist/src/platforms/kakaotalk/protocol/packet.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts +18 -0
- package/dist/src/platforms/kakaotalk/protocol/session.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/session.js +127 -0
- package/dist/src/platforms/kakaotalk/protocol/session.js.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/types.d.ts +41 -0
- package/dist/src/platforms/kakaotalk/protocol/types.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/protocol/types.js +8 -0
- package/dist/src/platforms/kakaotalk/protocol/types.js.map +1 -0
- package/dist/src/platforms/kakaotalk/token-extractor.d.ts +17 -0
- package/dist/src/platforms/kakaotalk/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/token-extractor.js +273 -0
- package/dist/src/platforms/kakaotalk/token-extractor.js.map +1 -0
- package/dist/src/platforms/kakaotalk/types.d.ts +198 -0
- package/dist/src/platforms/kakaotalk/types.d.ts.map +1 -0
- package/dist/src/platforms/kakaotalk/types.js +74 -0
- package/dist/src/platforms/kakaotalk/types.js.map +1 -0
- package/dist/src/platforms/line/cli.d.ts +5 -0
- package/dist/src/platforms/line/cli.d.ts.map +1 -0
- package/dist/src/platforms/line/cli.js +32 -0
- package/dist/src/platforms/line/cli.js.map +1 -0
- package/dist/src/platforms/line/client.d.ts +31 -0
- package/dist/src/platforms/line/client.d.ts.map +1 -0
- package/dist/src/platforms/line/client.js +296 -0
- package/dist/src/platforms/line/client.js.map +1 -0
- package/dist/src/platforms/line/commands/auth.d.ts +3 -0
- package/dist/src/platforms/line/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/auth.js +199 -0
- package/dist/src/platforms/line/commands/auth.js.map +1 -0
- package/dist/src/platforms/line/commands/chat.d.ts +3 -0
- package/dist/src/platforms/line/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/chat.js +28 -0
- package/dist/src/platforms/line/commands/chat.js.map +1 -0
- package/dist/src/platforms/line/commands/friend.d.ts +3 -0
- package/dist/src/platforms/line/commands/friend.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/friend.js +25 -0
- package/dist/src/platforms/line/commands/friend.js.map +1 -0
- package/dist/src/platforms/line/commands/index.d.ts +6 -0
- package/dist/src/platforms/line/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/index.js +6 -0
- package/dist/src/platforms/line/commands/index.js.map +1 -0
- package/dist/src/platforms/line/commands/message.d.ts +3 -0
- package/dist/src/platforms/line/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/message.js +48 -0
- package/dist/src/platforms/line/commands/message.js.map +1 -0
- package/dist/src/platforms/line/commands/profile.d.ts +3 -0
- package/dist/src/platforms/line/commands/profile.d.ts.map +1 -0
- package/dist/src/platforms/line/commands/profile.js +23 -0
- package/dist/src/platforms/line/commands/profile.js.map +1 -0
- package/dist/src/platforms/line/credential-manager.d.ts +22 -0
- package/dist/src/platforms/line/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/line/credential-manager.js +71 -0
- package/dist/src/platforms/line/credential-manager.js.map +1 -0
- package/dist/src/platforms/line/ensure-auth.d.ts +3 -0
- package/dist/src/platforms/line/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/line/ensure-auth.js +10 -0
- package/dist/src/platforms/line/ensure-auth.js.map +1 -0
- package/dist/src/platforms/line/index.d.ts +7 -0
- package/dist/src/platforms/line/index.d.ts.map +1 -0
- package/dist/src/platforms/line/index.js +6 -0
- package/dist/src/platforms/line/index.js.map +1 -0
- package/dist/src/platforms/line/listener.d.ts +22 -0
- package/dist/src/platforms/line/listener.d.ts.map +1 -0
- package/dist/src/platforms/line/listener.js +121 -0
- package/dist/src/platforms/line/listener.js.map +1 -0
- package/dist/src/platforms/line/types.d.ts +165 -0
- package/dist/src/platforms/line/types.d.ts.map +1 -0
- package/dist/src/platforms/line/types.js +79 -0
- package/dist/src/platforms/line/types.js.map +1 -0
- package/dist/src/platforms/slack/cli.d.ts.map +1 -1
- package/dist/src/platforms/slack/cli.js +6 -1
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/client.d.ts +85 -3
- package/dist/src/platforms/slack/client.d.ts.map +1 -1
- package/dist/src/platforms/slack/client.js +577 -40
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/activity.js +1 -1
- package/dist/src/platforms/slack/commands/activity.js.map +1 -1
- package/dist/src/platforms/slack/commands/auth.js +2 -2
- package/dist/src/platforms/slack/commands/auth.js.map +1 -1
- package/dist/src/platforms/slack/commands/bookmark.d.ts +3 -0
- package/dist/src/platforms/slack/commands/bookmark.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/bookmark.js +116 -0
- package/dist/src/platforms/slack/commands/bookmark.js.map +1 -0
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/channel.js +198 -5
- package/dist/src/platforms/slack/commands/channel.js.map +1 -1
- package/dist/src/platforms/slack/commands/drafts.js +1 -1
- package/dist/src/platforms/slack/commands/drafts.js.map +1 -1
- package/dist/src/platforms/slack/commands/emoji.d.ts +3 -0
- package/dist/src/platforms/slack/commands/emoji.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/emoji.js +27 -0
- package/dist/src/platforms/slack/commands/emoji.js.map +1 -0
- package/dist/src/platforms/slack/commands/file.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/file.js +26 -5
- package/dist/src/platforms/slack/commands/file.js.map +1 -1
- package/dist/src/platforms/slack/commands/index.d.ts +5 -0
- package/dist/src/platforms/slack/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/index.js +5 -0
- package/dist/src/platforms/slack/commands/index.js.map +1 -1
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/message.js +134 -8
- package/dist/src/platforms/slack/commands/message.js.map +1 -1
- package/dist/src/platforms/slack/commands/pin.d.ts +3 -0
- package/dist/src/platforms/slack/commands/pin.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/pin.js +76 -0
- package/dist/src/platforms/slack/commands/pin.js.map +1 -0
- package/dist/src/platforms/slack/commands/reaction.js +3 -3
- package/dist/src/platforms/slack/commands/reaction.js.map +1 -1
- package/dist/src/platforms/slack/commands/reminder.d.ts +3 -0
- package/dist/src/platforms/slack/commands/reminder.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/reminder.js +98 -0
- package/dist/src/platforms/slack/commands/reminder.js.map +1 -0
- package/dist/src/platforms/slack/commands/saved.js +1 -1
- package/dist/src/platforms/slack/commands/saved.js.map +1 -1
- package/dist/src/platforms/slack/commands/sections.js +1 -1
- package/dist/src/platforms/slack/commands/sections.js.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/snapshot.js +12 -1
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/slack/commands/unread.js +3 -3
- package/dist/src/platforms/slack/commands/unread.js.map +1 -1
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/slack/commands/user.js +78 -1
- package/dist/src/platforms/slack/commands/user.js.map +1 -1
- package/dist/src/platforms/slack/commands/usergroup.d.ts +3 -0
- package/dist/src/platforms/slack/commands/usergroup.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/usergroup.js +190 -0
- package/dist/src/platforms/slack/commands/usergroup.js.map +1 -0
- package/dist/src/platforms/slack/credential-manager.d.ts +2 -1
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slack/credential-manager.js +2 -1
- package/dist/src/platforms/slack/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/ensure-auth.js +4 -4
- package/dist/src/platforms/slack/ensure-auth.js.map +1 -1
- package/dist/src/platforms/slack/index.d.ts +4 -1
- package/dist/src/platforms/slack/index.d.ts.map +1 -1
- package/dist/src/platforms/slack/index.js +3 -1
- package/dist/src/platforms/slack/index.js.map +1 -1
- package/dist/src/platforms/slack/listener.d.ts +30 -0
- package/dist/src/platforms/slack/listener.d.ts.map +1 -0
- package/dist/src/platforms/slack/listener.js +157 -0
- package/dist/src/platforms/slack/listener.js.map +1 -0
- package/dist/src/platforms/slack/types.d.ts +198 -275
- package/dist/src/platforms/slack/types.d.ts.map +1 -1
- package/dist/src/platforms/slack/types.js +22 -0
- package/dist/src/platforms/slack/types.js.map +1 -1
- package/dist/src/platforms/slackbot/client.d.ts +4 -1
- package/dist/src/platforms/slackbot/client.d.ts.map +1 -1
- package/dist/src/platforms/slackbot/client.js +40 -21
- package/dist/src/platforms/slackbot/client.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/auth.js +2 -2
- package/dist/src/platforms/slackbot/commands/auth.js.map +1 -1
- package/dist/src/platforms/slackbot/commands/shared.js +1 -1
- package/dist/src/platforms/slackbot/commands/shared.js.map +1 -1
- package/dist/src/platforms/slackbot/types.d.ts +20 -282
- package/dist/src/platforms/slackbot/types.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.d.ts +5 -1
- package/dist/src/platforms/teams/client.d.ts.map +1 -1
- package/dist/src/platforms/teams/client.js +27 -9
- package/dist/src/platforms/teams/client.js.map +1 -1
- package/dist/src/platforms/teams/commands/auth.js +3 -3
- package/dist/src/platforms/teams/commands/auth.js.map +1 -1
- package/dist/src/platforms/teams/commands/channel.js +3 -3
- package/dist/src/platforms/teams/commands/channel.js.map +1 -1
- package/dist/src/platforms/teams/commands/file.js +3 -3
- package/dist/src/platforms/teams/commands/file.js.map +1 -1
- package/dist/src/platforms/teams/commands/message.js +4 -4
- package/dist/src/platforms/teams/commands/message.js.map +1 -1
- package/dist/src/platforms/teams/commands/reaction.js +2 -2
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -1
- package/dist/src/platforms/teams/commands/snapshot.js +1 -1
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/teams/commands/team.js +1 -1
- package/dist/src/platforms/teams/commands/team.js.map +1 -1
- package/dist/src/platforms/teams/commands/user.js +3 -3
- package/dist/src/platforms/teams/commands/user.js.map +1 -1
- package/dist/src/platforms/teams/ensure-auth.js +1 -1
- package/dist/src/platforms/teams/ensure-auth.js.map +1 -1
- package/dist/src/platforms/teams/index.d.ts +6 -0
- package/dist/src/platforms/teams/index.d.ts.map +1 -0
- package/dist/src/platforms/teams/index.js +5 -0
- package/dist/src/platforms/teams/index.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +26 -193
- package/dist/src/platforms/teams/types.d.ts.map +1 -1
- package/dist/src/platforms/telegram/app-config.d.ts +7 -0
- package/dist/src/platforms/telegram/app-config.d.ts.map +1 -0
- package/dist/src/platforms/telegram/app-config.js +39 -0
- package/dist/src/platforms/telegram/app-config.js.map +1 -0
- package/dist/src/platforms/telegram/chat-utils.d.ts +5 -0
- package/dist/src/platforms/telegram/chat-utils.d.ts.map +1 -0
- package/dist/src/platforms/telegram/chat-utils.js +33 -0
- package/dist/src/platforms/telegram/chat-utils.js.map +1 -0
- package/dist/src/platforms/telegram/cli.d.ts +5 -0
- package/dist/src/platforms/telegram/cli.d.ts.map +1 -0
- package/dist/src/platforms/telegram/cli.js +15 -0
- package/dist/src/platforms/telegram/cli.js.map +1 -0
- package/dist/src/platforms/telegram/client.d.ts +47 -0
- package/dist/src/platforms/telegram/client.d.ts.map +1 -0
- package/dist/src/platforms/telegram/client.js +481 -0
- package/dist/src/platforms/telegram/client.js.map +1 -0
- package/dist/src/platforms/telegram/commands/auth.d.ts +44 -0
- package/dist/src/platforms/telegram/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/auth.js +522 -0
- package/dist/src/platforms/telegram/commands/auth.js.map +1 -0
- package/dist/src/platforms/telegram/commands/chat.d.ts +3 -0
- package/dist/src/platforms/telegram/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/chat.js +55 -0
- package/dist/src/platforms/telegram/commands/chat.js.map +1 -0
- package/dist/src/platforms/telegram/commands/index.d.ts +4 -0
- package/dist/src/platforms/telegram/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/index.js +4 -0
- package/dist/src/platforms/telegram/commands/index.js.map +1 -0
- package/dist/src/platforms/telegram/commands/message.d.ts +3 -0
- package/dist/src/platforms/telegram/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/message.js +40 -0
- package/dist/src/platforms/telegram/commands/message.js.map +1 -0
- package/dist/src/platforms/telegram/commands/shared.d.ts +10 -0
- package/dist/src/platforms/telegram/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/telegram/commands/shared.js +32 -0
- package/dist/src/platforms/telegram/commands/shared.js.map +1 -0
- package/dist/src/platforms/telegram/credential-manager.d.ts +25 -0
- package/dist/src/platforms/telegram/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/telegram/credential-manager.js +159 -0
- package/dist/src/platforms/telegram/credential-manager.js.map +1 -0
- package/dist/src/platforms/telegram/my-telegram-org.d.ts +14 -0
- package/dist/src/platforms/telegram/my-telegram-org.d.ts.map +1 -0
- package/dist/src/platforms/telegram/my-telegram-org.js +164 -0
- package/dist/src/platforms/telegram/my-telegram-org.js.map +1 -0
- package/dist/src/platforms/telegram/tdlib.d.ts +11 -0
- package/dist/src/platforms/telegram/tdlib.d.ts.map +1 -0
- package/dist/src/platforms/telegram/tdlib.js +113 -0
- package/dist/src/platforms/telegram/tdlib.js.map +1 -0
- package/dist/src/platforms/telegram/types.d.ts +192 -0
- package/dist/src/platforms/telegram/types.d.ts.map +1 -0
- package/dist/src/platforms/telegram/types.js +183 -0
- package/dist/src/platforms/telegram/types.js.map +1 -0
- package/dist/src/platforms/whatsapp/cli.d.ts +6 -0
- package/dist/src/platforms/whatsapp/cli.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/cli.js +31 -0
- package/dist/src/platforms/whatsapp/cli.js.map +1 -0
- package/dist/src/platforms/whatsapp/client.d.ts +39 -0
- package/dist/src/platforms/whatsapp/client.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/client.js +436 -0
- package/dist/src/platforms/whatsapp/client.js.map +1 -0
- package/dist/src/platforms/whatsapp/commands/auth.d.ts +3 -0
- package/dist/src/platforms/whatsapp/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/auth.js +170 -0
- package/dist/src/platforms/whatsapp/commands/auth.js.map +1 -0
- package/dist/src/platforms/whatsapp/commands/chat.d.ts +3 -0
- package/dist/src/platforms/whatsapp/commands/chat.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/chat.js +42 -0
- package/dist/src/platforms/whatsapp/commands/chat.js.map +1 -0
- package/dist/src/platforms/whatsapp/commands/index.d.ts +4 -0
- package/dist/src/platforms/whatsapp/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/index.js +4 -0
- package/dist/src/platforms/whatsapp/commands/index.js.map +1 -0
- package/dist/src/platforms/whatsapp/commands/message.d.ts +3 -0
- package/dist/src/platforms/whatsapp/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/message.js +61 -0
- package/dist/src/platforms/whatsapp/commands/message.js.map +1 -0
- package/dist/src/platforms/whatsapp/commands/shared.d.ts +8 -0
- package/dist/src/platforms/whatsapp/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/commands/shared.js +37 -0
- package/dist/src/platforms/whatsapp/commands/shared.js.map +1 -0
- package/dist/src/platforms/whatsapp/credential-manager.d.ts +20 -0
- package/dist/src/platforms/whatsapp/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/credential-manager.js +104 -0
- package/dist/src/platforms/whatsapp/credential-manager.js.map +1 -0
- package/dist/src/platforms/whatsapp/ensure-auth.d.ts +2 -0
- package/dist/src/platforms/whatsapp/ensure-auth.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/ensure-auth.js +23 -0
- package/dist/src/platforms/whatsapp/ensure-auth.js.map +1 -0
- package/dist/src/platforms/whatsapp/index.d.ts +4 -0
- package/dist/src/platforms/whatsapp/index.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/index.js +4 -0
- package/dist/src/platforms/whatsapp/index.js.map +1 -0
- package/dist/src/platforms/whatsapp/suppress-ws-warnings.d.ts +11 -0
- package/dist/src/platforms/whatsapp/suppress-ws-warnings.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/suppress-ws-warnings.js +24 -0
- package/dist/src/platforms/whatsapp/suppress-ws-warnings.js.map +1 -0
- package/dist/src/platforms/whatsapp/types.d.ts +42 -0
- package/dist/src/platforms/whatsapp/types.d.ts.map +1 -0
- package/dist/src/platforms/whatsapp/types.js +75 -0
- package/dist/src/platforms/whatsapp/types.js.map +1 -0
- package/dist/src/platforms/whatsappbot/cli.d.ts +5 -0
- package/dist/src/platforms/whatsappbot/cli.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/cli.js +17 -0
- package/dist/src/platforms/whatsappbot/cli.js.map +1 -0
- package/dist/src/platforms/whatsappbot/client.d.ts +31 -0
- package/dist/src/platforms/whatsappbot/client.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/client.js +202 -0
- package/dist/src/platforms/whatsappbot/client.js.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/auth.d.ts +28 -0
- package/dist/src/platforms/whatsappbot/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/auth.js +163 -0
- package/dist/src/platforms/whatsappbot/commands/auth.js.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/index.d.ts +4 -0
- package/dist/src/platforms/whatsappbot/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/index.js +4 -0
- package/dist/src/platforms/whatsappbot/commands/index.js.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/message.d.ts +27 -0
- package/dist/src/platforms/whatsappbot/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/message.js +122 -0
- package/dist/src/platforms/whatsappbot/commands/message.js.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/shared.d.ts +9 -0
- package/dist/src/platforms/whatsappbot/commands/shared.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/shared.js +13 -0
- package/dist/src/platforms/whatsappbot/commands/shared.js.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/template.d.ts +16 -0
- package/dist/src/platforms/whatsappbot/commands/template.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/commands/template.js +51 -0
- package/dist/src/platforms/whatsappbot/commands/template.js.map +1 -0
- package/dist/src/platforms/whatsappbot/credential-manager.d.ts +17 -0
- package/dist/src/platforms/whatsappbot/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/credential-manager.js +121 -0
- package/dist/src/platforms/whatsappbot/credential-manager.js.map +1 -0
- package/dist/src/platforms/whatsappbot/index.d.ts +5 -0
- package/dist/src/platforms/whatsappbot/index.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/index.js +4 -0
- package/dist/src/platforms/whatsappbot/index.js.map +1 -0
- package/dist/src/platforms/whatsappbot/types.d.ts +66 -0
- package/dist/src/platforms/whatsappbot/types.d.ts.map +1 -0
- package/dist/src/platforms/whatsappbot/types.js +28 -0
- package/dist/src/platforms/whatsappbot/types.js.map +1 -0
- package/dist/src/tui/adapters/channeltalk-adapter.d.ts +19 -0
- package/dist/src/tui/adapters/channeltalk-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/channeltalk-adapter.js +88 -0
- package/dist/src/tui/adapters/channeltalk-adapter.js.map +1 -0
- package/dist/src/tui/adapters/discord-adapter.d.ts +22 -0
- package/dist/src/tui/adapters/discord-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/discord-adapter.js +100 -0
- package/dist/src/tui/adapters/discord-adapter.js.map +1 -0
- package/dist/src/tui/adapters/instagram-adapter.d.ts +18 -0
- package/dist/src/tui/adapters/instagram-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/instagram-adapter.js +115 -0
- package/dist/src/tui/adapters/instagram-adapter.js.map +1 -0
- package/dist/src/tui/adapters/kakaotalk-adapter.d.ts +18 -0
- package/dist/src/tui/adapters/kakaotalk-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/kakaotalk-adapter.js +146 -0
- package/dist/src/tui/adapters/kakaotalk-adapter.js.map +1 -0
- package/dist/src/tui/adapters/line-adapter.d.ts +18 -0
- package/dist/src/tui/adapters/line-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/line-adapter.js +92 -0
- package/dist/src/tui/adapters/line-adapter.js.map +1 -0
- package/dist/src/tui/adapters/slack-adapter.d.ts +23 -0
- package/dist/src/tui/adapters/slack-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/slack-adapter.js +111 -0
- package/dist/src/tui/adapters/slack-adapter.js.map +1 -0
- package/dist/src/tui/adapters/teams-adapter.d.ts +20 -0
- package/dist/src/tui/adapters/teams-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/teams-adapter.js +85 -0
- package/dist/src/tui/adapters/teams-adapter.js.map +1 -0
- package/dist/src/tui/adapters/telegram-adapter.d.ts +18 -0
- package/dist/src/tui/adapters/telegram-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/telegram-adapter.js +183 -0
- package/dist/src/tui/adapters/telegram-adapter.js.map +1 -0
- package/dist/src/tui/adapters/types.d.ts +41 -0
- package/dist/src/tui/adapters/types.d.ts.map +1 -0
- package/dist/src/tui/adapters/types.js +2 -0
- package/dist/src/tui/adapters/types.js.map +1 -0
- package/dist/src/tui/adapters/whatsapp-adapter.d.ts +18 -0
- package/dist/src/tui/adapters/whatsapp-adapter.d.ts.map +1 -0
- package/dist/src/tui/adapters/whatsapp-adapter.js +120 -0
- package/dist/src/tui/adapters/whatsapp-adapter.js.map +1 -0
- package/dist/src/tui/app.d.ts +2 -0
- package/dist/src/tui/app.d.ts.map +1 -0
- package/dist/src/tui/app.js +652 -0
- package/dist/src/tui/app.js.map +1 -0
- package/dist/src/tui/cli.d.ts +3 -0
- package/dist/src/tui/cli.d.ts.map +1 -0
- package/dist/src/tui/cli.js +14 -0
- package/dist/src/tui/cli.js.map +1 -0
- package/dist/src/tui/utils.d.ts +5 -0
- package/dist/src/tui/utils.d.ts.map +1 -0
- package/dist/src/tui/utils.js +54 -0
- package/dist/src/tui/utils.js.map +1 -0
- package/dist/src/tui/views/channel-picker.d.ts +18 -0
- package/dist/src/tui/views/channel-picker.d.ts.map +1 -0
- package/dist/src/tui/views/channel-picker.js +131 -0
- package/dist/src/tui/views/channel-picker.js.map +1 -0
- package/dist/src/tui/views/workspace-picker.d.ts +18 -0
- package/dist/src/tui/views/workspace-picker.d.ts.map +1 -0
- package/dist/src/tui/views/workspace-picker.js +131 -0
- package/dist/src/tui/views/workspace-picker.js.map +1 -0
- package/docs/bun.lock +2 -666
- package/docs/content/docs/agent-skills.mdx +1 -1
- package/docs/content/docs/cli/channeltalk.mdx +264 -0
- package/docs/content/docs/cli/channeltalkbot.mdx +261 -0
- package/docs/content/docs/cli/instagram.mdx +211 -0
- package/docs/content/docs/cli/kakaotalk.mdx +286 -0
- package/docs/content/docs/cli/line.mdx +306 -0
- package/docs/content/docs/cli/meta.json +18 -0
- package/docs/content/docs/cli/slack.mdx +395 -0
- package/docs/content/docs/{integrations → cli}/slackbot.mdx +1 -1
- package/docs/content/docs/{integrations → cli}/teams.mdx +2 -2
- package/docs/content/docs/cli/telegram.mdx +107 -0
- package/docs/content/docs/cli/whatsapp.mdx +163 -0
- package/docs/content/docs/cli/whatsappbot.mdx +169 -0
- package/docs/content/docs/index.mdx +21 -13
- package/docs/content/docs/meta.json +9 -1
- package/docs/content/docs/quick-start.mdx +29 -6
- package/docs/content/docs/sdk/channeltalk.mdx +384 -0
- package/docs/content/docs/sdk/channeltalkbot.mdx +395 -0
- package/docs/content/docs/sdk/discord.mdx +535 -0
- package/docs/content/docs/sdk/instagram.mdx +367 -0
- package/docs/content/docs/sdk/kakaotalk.mdx +290 -0
- package/docs/content/docs/sdk/line.mdx +347 -0
- package/docs/content/docs/sdk/meta.json +4 -0
- package/docs/content/docs/sdk/slack.mdx +671 -0
- package/docs/content/docs/sdk/teams.mdx +350 -0
- package/docs/content/docs/sdk/whatsapp.mdx +293 -0
- package/docs/content/docs/sdk/whatsappbot.mdx +266 -0
- package/docs/content/docs/tui.mdx +137 -0
- package/docs/public/tui.png +0 -0
- package/docs/src/app/page.tsx +885 -308
- package/e2e/discordbot.e2e.test.ts +1 -1
- package/examples/discord-listen.ts +56 -0
- package/examples/kakaotalk-listen.ts +49 -0
- package/examples/slack-listen.ts +60 -0
- package/package.json +118 -9
- package/scripts/postbuild.ts +1 -0
- package/scripts/prepublish.ts +21 -1
- package/skills/agent-channeltalk/SKILL.md +18 -6
- package/skills/agent-channeltalkbot/SKILL.md +1 -1
- package/skills/agent-discord/SKILL.md +77 -2
- package/skills/agent-discord/references/common-patterns.md +1 -1
- package/skills/agent-discordbot/SKILL.md +1 -1
- package/skills/agent-instagram/SKILL.md +383 -0
- package/skills/agent-instagram/references/authentication.md +256 -0
- package/skills/agent-instagram/references/common-patterns.md +362 -0
- package/skills/agent-instagram/templates/chat-summary.sh +124 -0
- package/skills/agent-instagram/templates/monitor-chat.sh +143 -0
- package/skills/agent-instagram/templates/post-message.sh +130 -0
- package/skills/agent-kakaotalk/SKILL.md +587 -0
- package/skills/agent-kakaotalk/references/authentication.md +343 -0
- package/skills/agent-kakaotalk/references/common-patterns.md +403 -0
- package/skills/agent-kakaotalk/templates/chat-summary.sh +121 -0
- package/skills/agent-kakaotalk/templates/monitor-chat.sh +160 -0
- package/skills/agent-kakaotalk/templates/post-message.sh +123 -0
- package/skills/agent-line/SKILL.md +490 -0
- package/skills/agent-line/references/authentication.md +297 -0
- package/skills/agent-line/references/common-patterns.md +355 -0
- package/skills/agent-line/templates/chat-summary.sh +63 -0
- package/skills/agent-line/templates/monitor-chat.sh +76 -0
- package/skills/agent-line/templates/post-message.sh +123 -0
- package/skills/agent-slack/SKILL.md +266 -7
- package/skills/agent-slack/references/common-patterns.md +105 -39
- package/skills/agent-slackbot/SKILL.md +1 -1
- package/skills/agent-slackbot/references/common-patterns.md +52 -0
- package/skills/agent-teams/SKILL.md +49 -1
- package/skills/agent-telegram/SKILL.md +123 -0
- package/skills/agent-whatsapp/SKILL.md +382 -0
- package/skills/agent-whatsapp/references/authentication.md +191 -0
- package/skills/agent-whatsapp/references/common-patterns.md +336 -0
- package/skills/agent-whatsapp/templates/chat-summary.sh +122 -0
- package/skills/agent-whatsapp/templates/monitor-chat.sh +157 -0
- package/skills/agent-whatsapp/templates/post-message.sh +120 -0
- package/skills/agent-whatsappbot/SKILL.md +371 -0
- package/skills/agent-whatsappbot/references/authentication.md +216 -0
- package/skills/agent-whatsappbot/references/common-patterns.md +331 -0
- package/skills/agent-whatsappbot/templates/account-summary.sh +127 -0
- package/skills/agent-whatsappbot/templates/post-message.sh +120 -0
- package/skills/agent-whatsappbot/templates/send-template.sh +153 -0
- package/src/cli.ts +34 -6
- package/src/platforms/channeltalk/client.test.ts +30 -28
- package/src/platforms/channeltalk/client.ts +29 -8
- package/src/platforms/channeltalk/commands/auth.ts +9 -7
- package/src/platforms/channeltalk/commands/shared.ts +1 -1
- package/src/platforms/channeltalk/ensure-auth.ts +10 -8
- package/src/platforms/channeltalk/index.test.ts +114 -0
- package/src/platforms/channeltalk/index.ts +27 -14
- package/src/platforms/channeltalk/token-extractor.test.ts +227 -65
- package/src/platforms/channeltalk/token-extractor.ts +146 -25
- package/src/platforms/channeltalk/types.ts +3 -1
- package/src/platforms/channeltalkbot/client.test.ts +12 -12
- package/src/platforms/channeltalkbot/client.ts +31 -11
- package/src/platforms/channeltalkbot/commands/auth.test.ts +1 -5
- package/src/platforms/channeltalkbot/commands/auth.ts +2 -2
- package/src/platforms/channeltalkbot/commands/shared.ts +1 -1
- package/src/platforms/channeltalkbot/index.test.ts +76 -0
- package/src/platforms/channeltalkbot/index.ts +14 -11
- package/src/platforms/discord/client.test.ts +30 -30
- package/src/platforms/discord/client.ts +33 -6
- package/src/platforms/discord/commands/auth.test.ts +2 -2
- package/src/platforms/discord/commands/auth.ts +2 -2
- package/src/platforms/discord/commands/channel.test.ts +6 -6
- package/src/platforms/discord/commands/channel.ts +3 -3
- package/src/platforms/discord/commands/dm.ts +2 -2
- package/src/platforms/discord/commands/file.ts +3 -3
- package/src/platforms/discord/commands/friend.test.ts +5 -5
- package/src/platforms/discord/commands/friend.ts +1 -1
- package/src/platforms/discord/commands/member.test.ts +4 -4
- package/src/platforms/discord/commands/member.ts +1 -1
- package/src/platforms/discord/commands/mention.test.ts +4 -4
- package/src/platforms/discord/commands/mention.ts +1 -1
- package/src/platforms/discord/commands/message.ts +6 -6
- package/src/platforms/discord/commands/note.ts +2 -2
- package/src/platforms/discord/commands/profile.ts +1 -1
- package/src/platforms/discord/commands/reaction.ts +3 -3
- package/src/platforms/discord/commands/server.test.ts +2 -2
- package/src/platforms/discord/commands/server.ts +1 -1
- package/src/platforms/discord/commands/snapshot.ts +1 -1
- package/src/platforms/discord/commands/thread.test.ts +5 -5
- package/src/platforms/discord/commands/thread.ts +2 -2
- package/src/platforms/discord/commands/user.ts +3 -3
- package/src/platforms/discord/ensure-auth.ts +1 -1
- package/src/platforms/discord/index.test.ts +84 -0
- package/src/platforms/discord/index.ts +51 -0
- package/src/platforms/discord/listener.test.ts +782 -0
- package/src/platforms/discord/listener.ts +297 -0
- package/src/platforms/discord/types.ts +133 -0
- package/src/platforms/discordbot/client.test.ts +33 -33
- package/src/platforms/discordbot/client.ts +28 -7
- package/src/platforms/discordbot/commands/auth.test.ts +1 -5
- package/src/platforms/discordbot/commands/auth.ts +2 -2
- package/src/platforms/discordbot/commands/channel.test.ts +1 -5
- package/src/platforms/discordbot/commands/message.test.ts +1 -3
- package/src/platforms/discordbot/commands/server.test.ts +1 -5
- package/src/platforms/discordbot/commands/shared.ts +1 -1
- package/src/platforms/discordbot/commands/snapshot.test.ts +1 -3
- package/src/platforms/discordbot/commands/thread.test.ts +1 -3
- package/src/platforms/discordbot/commands/user.test.ts +1 -5
- package/src/platforms/instagram/cli.ts +37 -0
- package/src/platforms/instagram/client.test.ts +396 -0
- package/src/platforms/instagram/client.ts +655 -0
- package/src/platforms/instagram/commands/auth.ts +401 -0
- package/src/platforms/instagram/commands/chat.ts +49 -0
- package/src/platforms/instagram/commands/index.ts +3 -0
- package/src/platforms/instagram/commands/message.ts +134 -0
- package/src/platforms/instagram/commands/shared.test.ts +51 -0
- package/src/platforms/instagram/commands/shared.ts +55 -0
- package/src/platforms/instagram/credential-manager.test.ts +277 -0
- package/src/platforms/instagram/credential-manager.ts +134 -0
- package/src/platforms/instagram/ensure-auth.test.ts +84 -0
- package/src/platforms/instagram/ensure-auth.ts +24 -0
- package/src/platforms/instagram/index.test.ts +44 -0
- package/src/platforms/instagram/index.ts +16 -0
- package/src/platforms/instagram/listener.test.ts +130 -0
- package/src/platforms/instagram/listener.ts +106 -0
- package/src/platforms/instagram/types.test.ts +228 -0
- package/src/platforms/instagram/types.ts +153 -0
- package/src/platforms/kakaotalk/auth/kakao-login.ts +296 -0
- package/src/platforms/kakaotalk/cli.ts +37 -0
- package/src/platforms/kakaotalk/client.test.ts +490 -0
- package/src/platforms/kakaotalk/client.ts +328 -0
- package/src/platforms/kakaotalk/commands/auth.ts +569 -0
- package/src/platforms/kakaotalk/commands/chat.ts +34 -0
- package/src/platforms/kakaotalk/commands/index.ts +3 -0
- package/src/platforms/kakaotalk/commands/message.ts +56 -0
- package/src/platforms/kakaotalk/commands/shared.ts +38 -0
- package/src/platforms/kakaotalk/credential-manager.test.ts +231 -0
- package/src/platforms/kakaotalk/credential-manager.ts +110 -0
- package/src/platforms/kakaotalk/ensure-auth.ts +16 -0
- package/src/platforms/kakaotalk/index.test.ts +68 -0
- package/src/platforms/kakaotalk/index.ts +30 -0
- package/src/platforms/kakaotalk/listener.test.ts +370 -0
- package/src/platforms/kakaotalk/listener.ts +203 -0
- package/src/platforms/kakaotalk/protocol/NOTICE.md +51 -0
- package/src/platforms/kakaotalk/protocol/config.ts +28 -0
- package/src/platforms/kakaotalk/protocol/connection.ts +159 -0
- package/src/platforms/kakaotalk/protocol/crypto.ts +71 -0
- package/src/platforms/kakaotalk/protocol/packet.ts +47 -0
- package/src/platforms/kakaotalk/protocol/session.ts +156 -0
- package/src/platforms/kakaotalk/protocol/types.ts +42 -0
- package/src/platforms/kakaotalk/token-extractor.ts +320 -0
- package/src/platforms/kakaotalk/types.ts +212 -0
- package/src/platforms/line/cli.ts +39 -0
- package/src/platforms/line/client.test.ts +162 -0
- package/src/platforms/line/client.ts +352 -0
- package/src/platforms/line/commands/auth.ts +219 -0
- package/src/platforms/line/commands/chat.ts +34 -0
- package/src/platforms/line/commands/friend.ts +28 -0
- package/src/platforms/line/commands/index.ts +5 -0
- package/src/platforms/line/commands/message.ts +59 -0
- package/src/platforms/line/commands/profile.ts +24 -0
- package/src/platforms/line/credential-manager.test.ts +163 -0
- package/src/platforms/line/credential-manager.ts +99 -0
- package/src/platforms/line/ensure-auth.ts +13 -0
- package/src/platforms/line/index.test.ts +48 -0
- package/src/platforms/line/index.ts +27 -0
- package/src/platforms/line/listener.test.ts +341 -0
- package/src/platforms/line/listener.ts +138 -0
- package/src/platforms/line/types.test.ts +157 -0
- package/src/platforms/line/types.ts +181 -0
- package/src/platforms/slack/cli.ts +10 -0
- package/src/platforms/slack/client.test.ts +703 -69
- package/src/platforms/slack/client.ts +664 -43
- package/src/platforms/slack/commands/activity.ts +1 -1
- package/src/platforms/slack/commands/auth.ts +2 -2
- package/src/platforms/slack/commands/bookmark.test.ts +91 -0
- package/src/platforms/slack/commands/bookmark.ts +148 -0
- package/src/platforms/slack/commands/channel.test.ts +47 -1
- package/src/platforms/slack/commands/channel.ts +255 -4
- package/src/platforms/slack/commands/drafts.ts +1 -1
- package/src/platforms/slack/commands/emoji.test.ts +32 -0
- package/src/platforms/slack/commands/emoji.ts +33 -0
- package/src/platforms/slack/commands/file.ts +30 -4
- package/src/platforms/slack/commands/index.ts +5 -0
- package/src/platforms/slack/commands/message.ts +173 -7
- package/src/platforms/slack/commands/pin.test.ts +72 -0
- package/src/platforms/slack/commands/pin.ts +93 -0
- package/src/platforms/slack/commands/reaction.ts +3 -3
- package/src/platforms/slack/commands/reminder.test.ts +86 -0
- package/src/platforms/slack/commands/reminder.ts +125 -0
- package/src/platforms/slack/commands/saved.ts +1 -1
- package/src/platforms/slack/commands/sections.ts +1 -1
- package/src/platforms/slack/commands/snapshot.test.ts +4 -4
- package/src/platforms/slack/commands/snapshot.ts +14 -1
- package/src/platforms/slack/commands/unread.test.ts +3 -3
- package/src/platforms/slack/commands/unread.ts +3 -3
- package/src/platforms/slack/commands/user.ts +90 -1
- package/src/platforms/slack/commands/usergroup.test.ts +157 -0
- package/src/platforms/slack/commands/usergroup.ts +242 -0
- package/src/platforms/slack/credential-manager.ts +3 -1
- package/src/platforms/slack/ensure-auth.ts +4 -4
- package/src/platforms/slack/index.test.ts +59 -0
- package/src/platforms/slack/index.ts +46 -1
- package/src/platforms/slack/listener.test.ts +370 -0
- package/src/platforms/slack/listener.ts +181 -0
- package/src/platforms/slack/types.ts +187 -0
- package/src/platforms/slackbot/client.test.ts +26 -26
- package/src/platforms/slackbot/client.ts +40 -22
- package/src/platforms/slackbot/commands/auth.test.ts +1 -5
- package/src/platforms/slackbot/commands/auth.ts +2 -2
- package/src/platforms/slackbot/commands/shared.ts +1 -1
- package/src/platforms/teams/client.test.ts +34 -34
- package/src/platforms/teams/client.ts +32 -9
- package/src/platforms/teams/commands/auth.test.ts +2 -2
- package/src/platforms/teams/commands/auth.ts +3 -3
- package/src/platforms/teams/commands/channel.test.ts +6 -6
- package/src/platforms/teams/commands/channel.ts +3 -3
- package/src/platforms/teams/commands/file.ts +3 -3
- package/src/platforms/teams/commands/message.ts +4 -4
- package/src/platforms/teams/commands/reaction.ts +2 -2
- package/src/platforms/teams/commands/snapshot.ts +1 -1
- package/src/platforms/teams/commands/team.test.ts +2 -2
- package/src/platforms/teams/commands/team.ts +1 -1
- package/src/platforms/teams/commands/user.ts +3 -3
- package/src/platforms/teams/ensure-auth.ts +1 -1
- package/src/platforms/teams/index.test.ts +74 -0
- package/src/platforms/teams/index.ts +30 -0
- package/src/platforms/telegram/app-config.test.ts +44 -0
- package/src/platforms/telegram/app-config.ts +53 -0
- package/src/platforms/telegram/chat-utils.test.ts +71 -0
- package/src/platforms/telegram/chat-utils.ts +39 -0
- package/src/platforms/telegram/cli.ts +20 -0
- package/src/platforms/telegram/client.test.ts +90 -0
- package/src/platforms/telegram/client.ts +623 -0
- package/src/platforms/telegram/commands/auth.test.ts +113 -0
- package/src/platforms/telegram/commands/auth.ts +662 -0
- package/src/platforms/telegram/commands/chat.ts +65 -0
- package/src/platforms/telegram/commands/index.ts +3 -0
- package/src/platforms/telegram/commands/message.ts +51 -0
- package/src/platforms/telegram/commands/shared.test.ts +15 -0
- package/src/platforms/telegram/commands/shared.ts +50 -0
- package/src/platforms/telegram/credential-manager.test.ts +152 -0
- package/src/platforms/telegram/credential-manager.ts +203 -0
- package/src/platforms/telegram/my-telegram-org.ts +206 -0
- package/src/platforms/telegram/tdlib.ts +159 -0
- package/src/platforms/telegram/types.test.ts +74 -0
- package/src/platforms/telegram/types.ts +417 -0
- package/src/platforms/whatsapp/cli.ts +38 -0
- package/src/platforms/whatsapp/client.ts +526 -0
- package/src/platforms/whatsapp/commands/auth.ts +205 -0
- package/src/platforms/whatsapp/commands/chat.ts +49 -0
- package/src/platforms/whatsapp/commands/index.ts +3 -0
- package/src/platforms/whatsapp/commands/message.ts +79 -0
- package/src/platforms/whatsapp/commands/shared.ts +61 -0
- package/src/platforms/whatsapp/credential-manager.test.ts +278 -0
- package/src/platforms/whatsapp/credential-manager.ts +134 -0
- package/src/platforms/whatsapp/ensure-auth.test.ts +85 -0
- package/src/platforms/whatsapp/ensure-auth.ts +26 -0
- package/src/platforms/whatsapp/index.test.ts +39 -0
- package/src/platforms/whatsapp/index.ts +16 -0
- package/src/platforms/whatsapp/suppress-ws-warnings.ts +21 -0
- package/src/platforms/whatsapp/types.test.ts +190 -0
- package/src/platforms/whatsapp/types.ts +95 -0
- package/src/platforms/whatsappbot/cli.ts +23 -0
- package/src/platforms/whatsappbot/client.test.ts +411 -0
- package/src/platforms/whatsappbot/client.ts +256 -0
- package/src/platforms/whatsappbot/commands/auth.ts +206 -0
- package/src/platforms/whatsappbot/commands/index.ts +3 -0
- package/src/platforms/whatsappbot/commands/message.ts +148 -0
- package/src/platforms/whatsappbot/commands/shared.ts +22 -0
- package/src/platforms/whatsappbot/commands/template.ts +69 -0
- package/src/platforms/whatsappbot/credential-manager.test.ts +303 -0
- package/src/platforms/whatsappbot/credential-manager.ts +148 -0
- package/src/platforms/whatsappbot/index.test.ts +34 -0
- package/src/platforms/whatsappbot/index.ts +18 -0
- package/src/platforms/whatsappbot/types.test.ts +141 -0
- package/src/platforms/whatsappbot/types.ts +71 -0
- package/src/tui/adapters/channeltalk-adapter.ts +102 -0
- package/src/tui/adapters/discord-adapter.ts +112 -0
- package/src/tui/adapters/instagram-adapter.ts +132 -0
- package/src/tui/adapters/kakaotalk-adapter.ts +163 -0
- package/src/tui/adapters/line-adapter.ts +109 -0
- package/src/tui/adapters/slack-adapter.ts +128 -0
- package/src/tui/adapters/teams-adapter.ts +95 -0
- package/src/tui/adapters/telegram-adapter.ts +203 -0
- package/src/tui/adapters/types.ts +43 -0
- package/src/tui/adapters/whatsapp-adapter.ts +138 -0
- package/src/tui/app.ts +689 -0
- package/src/tui/cli.ts +18 -0
- package/src/tui/utils.test.ts +149 -0
- package/src/tui/utils.ts +58 -0
- package/src/tui/views/channel-picker.ts +146 -0
- package/src/tui/views/workspace-picker.ts +146 -0
- package/docs/content/docs/integrations/meta.json +0 -5
- package/docs/content/docs/integrations/slack.mdx +0 -218
- package/docs/content/docs/{integrations → cli}/discord.mdx +19 -19
- package/docs/content/docs/{integrations → cli}/discordbot.mdx +8 -8
|
@@ -2,17 +2,23 @@ import { WebClient } from '@slack/web-api'
|
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
SlackActivityItem,
|
|
5
|
+
SlackBookmark,
|
|
5
6
|
SlackChannel,
|
|
6
7
|
SlackChannelSection,
|
|
7
8
|
SlackDM,
|
|
8
9
|
SlackDraft,
|
|
9
10
|
SlackFile,
|
|
10
11
|
SlackMessage,
|
|
12
|
+
SlackPin,
|
|
13
|
+
SlackReminder,
|
|
11
14
|
SlackSavedItem,
|
|
15
|
+
SlackScheduledMessage,
|
|
12
16
|
SlackSearchResult,
|
|
13
17
|
SlackThreadView,
|
|
14
18
|
SlackUnreadCounts,
|
|
15
19
|
SlackUser,
|
|
20
|
+
SlackUserProfile,
|
|
21
|
+
SlackUsergroup,
|
|
16
22
|
} from './types'
|
|
17
23
|
|
|
18
24
|
export class SlackError extends Error {
|
|
@@ -29,23 +35,45 @@ const MAX_RETRIES = 3
|
|
|
29
35
|
const RATE_LIMIT_ERROR_CODE = 'slack_webapi_rate_limited_error'
|
|
30
36
|
|
|
31
37
|
export class SlackClient {
|
|
32
|
-
private client: WebClient
|
|
33
|
-
private token: string
|
|
34
|
-
private cookie: string
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (
|
|
38
|
-
|
|
38
|
+
private client: WebClient | null = null
|
|
39
|
+
private token: string | null = null
|
|
40
|
+
private cookie: string | null = null
|
|
41
|
+
|
|
42
|
+
async login(credentials?: { token: string; cookie: string }): Promise<this> {
|
|
43
|
+
if (credentials) {
|
|
44
|
+
if (!credentials.token) {
|
|
45
|
+
throw new SlackError('Token is required', 'missing_token')
|
|
46
|
+
}
|
|
47
|
+
if (!credentials.cookie) {
|
|
48
|
+
throw new SlackError('Cookie is required', 'missing_cookie')
|
|
49
|
+
}
|
|
50
|
+
this.token = credentials.token
|
|
51
|
+
this.cookie = credentials.cookie
|
|
52
|
+
this.client = new WebClient(credentials.token, {
|
|
53
|
+
headers: { Cookie: `d=${credentials.cookie}` },
|
|
54
|
+
})
|
|
55
|
+
return this
|
|
39
56
|
}
|
|
40
|
-
|
|
41
|
-
|
|
57
|
+
|
|
58
|
+
const { ensureSlackAuth } = await import('./ensure-auth')
|
|
59
|
+
await ensureSlackAuth()
|
|
60
|
+
const { SlackCredentialManager } = await import('./credential-manager')
|
|
61
|
+
const credManager = new SlackCredentialManager()
|
|
62
|
+
const workspace = await credManager.getWorkspace()
|
|
63
|
+
if (!workspace) {
|
|
64
|
+
throw new SlackError(
|
|
65
|
+
'No workspace credentials found. Make sure Slack desktop app is installed and logged in.',
|
|
66
|
+
'no_credentials',
|
|
67
|
+
)
|
|
42
68
|
}
|
|
69
|
+
return this.login({ token: workspace.token, cookie: workspace.cookie })
|
|
70
|
+
}
|
|
43
71
|
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
72
|
+
private ensureAuth(): WebClient {
|
|
73
|
+
if (!this.client) {
|
|
74
|
+
throw new SlackError('Not authenticated. Call .login() first.', 'not_authenticated')
|
|
75
|
+
}
|
|
76
|
+
return this.client
|
|
49
77
|
}
|
|
50
78
|
|
|
51
79
|
private async withRetry<T>(operation: () => Promise<T>): Promise<T> {
|
|
@@ -78,7 +106,7 @@ export class SlackClient {
|
|
|
78
106
|
|
|
79
107
|
async testAuth(): Promise<{ user_id: string; team_id: string; user?: string; team?: string }> {
|
|
80
108
|
return this.withRetry(async () => {
|
|
81
|
-
const response = await this.
|
|
109
|
+
const response = await this.ensureAuth().auth.test()
|
|
82
110
|
this.checkResponse(response)
|
|
83
111
|
return {
|
|
84
112
|
user_id: response.user_id!,
|
|
@@ -95,7 +123,7 @@ export class SlackClient {
|
|
|
95
123
|
let cursor: string | undefined
|
|
96
124
|
|
|
97
125
|
do {
|
|
98
|
-
const response = await this.
|
|
126
|
+
const response = await this.ensureAuth().conversations.list({
|
|
99
127
|
cursor,
|
|
100
128
|
limit: 200,
|
|
101
129
|
types: 'public_channel,private_channel',
|
|
@@ -142,7 +170,7 @@ export class SlackClient {
|
|
|
142
170
|
let cursor: string | undefined
|
|
143
171
|
|
|
144
172
|
do {
|
|
145
|
-
const response = await this.
|
|
173
|
+
const response = await this.ensureAuth().conversations.list({
|
|
146
174
|
cursor,
|
|
147
175
|
limit: 200,
|
|
148
176
|
types: 'im,mpim',
|
|
@@ -169,7 +197,7 @@ export class SlackClient {
|
|
|
169
197
|
|
|
170
198
|
async getChannel(id: string): Promise<SlackChannel> {
|
|
171
199
|
return this.withRetry(async () => {
|
|
172
|
-
const response = await this.
|
|
200
|
+
const response = await this.ensureAuth().conversations.info({ channel: id })
|
|
173
201
|
this.checkResponse(response)
|
|
174
202
|
|
|
175
203
|
const ch = response.channel!
|
|
@@ -222,7 +250,7 @@ export class SlackClient {
|
|
|
222
250
|
|
|
223
251
|
async sendMessage(channel: string, text: string, threadTs?: string): Promise<SlackMessage> {
|
|
224
252
|
return this.withRetry(async () => {
|
|
225
|
-
const response = await this.
|
|
253
|
+
const response = await this.ensureAuth().chat.postMessage({
|
|
226
254
|
channel,
|
|
227
255
|
text,
|
|
228
256
|
thread_ts: threadTs,
|
|
@@ -240,11 +268,19 @@ export class SlackClient {
|
|
|
240
268
|
})
|
|
241
269
|
}
|
|
242
270
|
|
|
243
|
-
async getMessages(
|
|
271
|
+
async getMessages(
|
|
272
|
+
channel: string,
|
|
273
|
+
limitOrOptions?: number | { limit?: number; oldest?: string; latest?: string },
|
|
274
|
+
): Promise<SlackMessage[]> {
|
|
275
|
+
const options = typeof limitOrOptions === 'number' ? { limit: limitOrOptions } : (limitOrOptions ?? {})
|
|
276
|
+
const { limit = 20, oldest, latest } = options
|
|
277
|
+
|
|
244
278
|
return this.withRetry(async () => {
|
|
245
|
-
const response = await this.
|
|
279
|
+
const response = await this.ensureAuth().conversations.history({
|
|
246
280
|
channel,
|
|
247
281
|
limit,
|
|
282
|
+
oldest,
|
|
283
|
+
latest,
|
|
248
284
|
})
|
|
249
285
|
this.checkResponse(response)
|
|
250
286
|
|
|
@@ -281,7 +317,7 @@ export class SlackClient {
|
|
|
281
317
|
|
|
282
318
|
async getMessage(channel: string, ts: string): Promise<SlackMessage | null> {
|
|
283
319
|
return this.withRetry(async () => {
|
|
284
|
-
const response = await this.
|
|
320
|
+
const response = await this.ensureAuth().conversations.history({
|
|
285
321
|
channel,
|
|
286
322
|
oldest: ts,
|
|
287
323
|
inclusive: true,
|
|
@@ -327,7 +363,7 @@ export class SlackClient {
|
|
|
327
363
|
|
|
328
364
|
async updateMessage(channel: string, ts: string, text: string): Promise<SlackMessage> {
|
|
329
365
|
return this.withRetry(async () => {
|
|
330
|
-
const response = await this.
|
|
366
|
+
const response = await this.ensureAuth().chat.update({
|
|
331
367
|
channel,
|
|
332
368
|
ts,
|
|
333
369
|
text,
|
|
@@ -346,7 +382,7 @@ export class SlackClient {
|
|
|
346
382
|
|
|
347
383
|
async deleteMessage(channel: string, ts: string): Promise<void> {
|
|
348
384
|
return this.withRetry(async () => {
|
|
349
|
-
const response = await this.
|
|
385
|
+
const response = await this.ensureAuth().chat.delete({
|
|
350
386
|
channel,
|
|
351
387
|
ts,
|
|
352
388
|
})
|
|
@@ -356,7 +392,7 @@ export class SlackClient {
|
|
|
356
392
|
|
|
357
393
|
async addReaction(channel: string, ts: string, emoji: string): Promise<void> {
|
|
358
394
|
return this.withRetry(async () => {
|
|
359
|
-
const response = await this.
|
|
395
|
+
const response = await this.ensureAuth().reactions.add({
|
|
360
396
|
channel,
|
|
361
397
|
timestamp: ts,
|
|
362
398
|
name: emoji,
|
|
@@ -367,7 +403,7 @@ export class SlackClient {
|
|
|
367
403
|
|
|
368
404
|
async removeReaction(channel: string, ts: string, emoji: string): Promise<void> {
|
|
369
405
|
return this.withRetry(async () => {
|
|
370
|
-
const response = await this.
|
|
406
|
+
const response = await this.ensureAuth().reactions.remove({
|
|
371
407
|
channel,
|
|
372
408
|
timestamp: ts,
|
|
373
409
|
name: emoji,
|
|
@@ -382,7 +418,7 @@ export class SlackClient {
|
|
|
382
418
|
let cursor: string | undefined
|
|
383
419
|
|
|
384
420
|
do {
|
|
385
|
-
const response = await this.
|
|
421
|
+
const response = await this.ensureAuth().users.list({
|
|
386
422
|
cursor,
|
|
387
423
|
limit: 200,
|
|
388
424
|
})
|
|
@@ -423,7 +459,7 @@ export class SlackClient {
|
|
|
423
459
|
let cursor: string | undefined
|
|
424
460
|
|
|
425
461
|
do {
|
|
426
|
-
const response = await this.
|
|
462
|
+
const response = await this.ensureAuth().conversations.members({
|
|
427
463
|
channel,
|
|
428
464
|
cursor,
|
|
429
465
|
limit: 200,
|
|
@@ -443,7 +479,7 @@ export class SlackClient {
|
|
|
443
479
|
|
|
444
480
|
async getUser(id: string): Promise<SlackUser> {
|
|
445
481
|
return this.withRetry(async () => {
|
|
446
|
-
const response = await this.
|
|
482
|
+
const response = await this.ensureAuth().users.info({ user: id })
|
|
447
483
|
this.checkResponse(response)
|
|
448
484
|
|
|
449
485
|
const member = response.user!
|
|
@@ -469,7 +505,7 @@ export class SlackClient {
|
|
|
469
505
|
|
|
470
506
|
async uploadFile(channels: string[], file: Buffer, filename: string): Promise<SlackFile> {
|
|
471
507
|
return this.withRetry(async () => {
|
|
472
|
-
const response = await this.
|
|
508
|
+
const response = await this.ensureAuth().files.uploadV2({
|
|
473
509
|
channel_id: channels[0],
|
|
474
510
|
file,
|
|
475
511
|
filename,
|
|
@@ -497,7 +533,7 @@ export class SlackClient {
|
|
|
497
533
|
|
|
498
534
|
async listFiles(channel?: string): Promise<SlackFile[]> {
|
|
499
535
|
return this.withRetry(async () => {
|
|
500
|
-
const response = await this.
|
|
536
|
+
const response = await this.ensureAuth().files.list({
|
|
501
537
|
channel,
|
|
502
538
|
})
|
|
503
539
|
this.checkResponse(response)
|
|
@@ -518,7 +554,7 @@ export class SlackClient {
|
|
|
518
554
|
|
|
519
555
|
async getFileInfo(fileId: string): Promise<SlackFile> {
|
|
520
556
|
return this.withRetry(async () => {
|
|
521
|
-
const response = await this.
|
|
557
|
+
const response = await this.ensureAuth().files.info({ file: fileId })
|
|
522
558
|
this.checkResponse(response)
|
|
523
559
|
|
|
524
560
|
const f = response.file!
|
|
@@ -543,10 +579,11 @@ export class SlackClient {
|
|
|
543
579
|
throw new SlackError('File has no download URL', 'no_download_url')
|
|
544
580
|
}
|
|
545
581
|
|
|
582
|
+
this.ensureAuth()
|
|
546
583
|
const response = await fetch(file.url_private, {
|
|
547
584
|
headers: {
|
|
548
|
-
Authorization: `Bearer ${this.token}`,
|
|
549
|
-
Cookie: `d=${this.cookie}`,
|
|
585
|
+
Authorization: `Bearer ${this.token!}`,
|
|
586
|
+
Cookie: `d=${this.cookie!}`,
|
|
550
587
|
},
|
|
551
588
|
})
|
|
552
589
|
|
|
@@ -566,7 +603,7 @@ export class SlackClient {
|
|
|
566
603
|
options: { sort?: 'score' | 'timestamp'; sortDir?: 'asc' | 'desc'; count?: number } = {},
|
|
567
604
|
): Promise<SlackSearchResult[]> {
|
|
568
605
|
return this.withRetry(async () => {
|
|
569
|
-
const response = await this.
|
|
606
|
+
const response = await this.ensureAuth().search.messages({
|
|
570
607
|
query,
|
|
571
608
|
sort: options.sort || 'timestamp',
|
|
572
609
|
sort_dir: options.sortDir || 'desc',
|
|
@@ -595,7 +632,7 @@ export class SlackClient {
|
|
|
595
632
|
options: { limit?: number; oldest?: string; latest?: string; cursor?: string } = {},
|
|
596
633
|
): Promise<{ messages: SlackMessage[]; has_more: boolean; next_cursor?: string }> {
|
|
597
634
|
return this.withRetry(async () => {
|
|
598
|
-
const response = await this.
|
|
635
|
+
const response = await this.ensureAuth().conversations.replies({
|
|
599
636
|
channel,
|
|
600
637
|
ts: threadTs,
|
|
601
638
|
limit: options.limit || 100,
|
|
@@ -643,7 +680,7 @@ export class SlackClient {
|
|
|
643
680
|
|
|
644
681
|
async getUnreadCounts(): Promise<SlackUnreadCounts> {
|
|
645
682
|
return this.withRetry(async () => {
|
|
646
|
-
const response = await this.
|
|
683
|
+
const response = await this.ensureAuth().apiCall('client.counts')
|
|
647
684
|
this.checkResponse(response)
|
|
648
685
|
|
|
649
686
|
const channels = ((response as any).channels || []).map((ch: any) => ({
|
|
@@ -663,7 +700,7 @@ export class SlackClient {
|
|
|
663
700
|
|
|
664
701
|
async getThreadView(channelId: string, ts: string): Promise<SlackThreadView> {
|
|
665
702
|
return this.withRetry(async () => {
|
|
666
|
-
const response = await (this.
|
|
703
|
+
const response = await (this.ensureAuth() as any).subscriptions.thread.getView({
|
|
667
704
|
channel: channelId,
|
|
668
705
|
thread_ts: ts,
|
|
669
706
|
})
|
|
@@ -682,7 +719,7 @@ export class SlackClient {
|
|
|
682
719
|
|
|
683
720
|
async markRead(channelId: string, ts: string): Promise<void> {
|
|
684
721
|
return this.withRetry(async () => {
|
|
685
|
-
const response = await this.
|
|
722
|
+
const response = await this.ensureAuth().conversations.mark({
|
|
686
723
|
channel: channelId,
|
|
687
724
|
ts,
|
|
688
725
|
})
|
|
@@ -692,7 +729,7 @@ export class SlackClient {
|
|
|
692
729
|
|
|
693
730
|
async getActivityFeed(options?: { types?: string; mode?: string; limit?: number }): Promise<SlackActivityItem[]> {
|
|
694
731
|
return this.withRetry(async () => {
|
|
695
|
-
const response = await this.
|
|
732
|
+
const response = await this.ensureAuth().apiCall('activity.feed', {
|
|
696
733
|
types: options?.types || 'thread_reply,message_reaction,at_user,at_channel,keyword',
|
|
697
734
|
mode: options?.mode || 'chrono_reads_and_unreads',
|
|
698
735
|
limit: options?.limit || 20,
|
|
@@ -719,7 +756,7 @@ export class SlackClient {
|
|
|
719
756
|
next_cursor?: string
|
|
720
757
|
}> {
|
|
721
758
|
return this.withRetry(async () => {
|
|
722
|
-
const response = await (this.
|
|
759
|
+
const response = await (this.ensureAuth() as any).apiCall('saved.list', {
|
|
723
760
|
cursor,
|
|
724
761
|
limit: 50,
|
|
725
762
|
})
|
|
@@ -760,7 +797,7 @@ export class SlackClient {
|
|
|
760
797
|
|
|
761
798
|
async getChannelSections(): Promise<SlackChannelSection[]> {
|
|
762
799
|
return this.withRetry(async () => {
|
|
763
|
-
const response = await (this.
|
|
800
|
+
const response = await (this.ensureAuth() as any).apiCall('users.channelSections.list')
|
|
764
801
|
this.checkResponse(response)
|
|
765
802
|
|
|
766
803
|
const sections = (response as any).channel_sections || []
|
|
@@ -774,9 +811,21 @@ export class SlackClient {
|
|
|
774
811
|
})
|
|
775
812
|
}
|
|
776
813
|
|
|
814
|
+
async openConversation(users: string): Promise<{ channel_id: string; already_open: boolean }> {
|
|
815
|
+
return this.withRetry(async () => {
|
|
816
|
+
const response = await this.ensureAuth().conversations.open({ users })
|
|
817
|
+
this.checkResponse(response)
|
|
818
|
+
|
|
819
|
+
return {
|
|
820
|
+
channel_id: response.channel!.id!,
|
|
821
|
+
already_open: response.already_open || false,
|
|
822
|
+
}
|
|
823
|
+
})
|
|
824
|
+
}
|
|
825
|
+
|
|
777
826
|
async getDrafts(cursor?: string): Promise<{ drafts: SlackDraft[]; next_cursor?: string }> {
|
|
778
827
|
return this.withRetry(async () => {
|
|
779
|
-
const response = await this.
|
|
828
|
+
const response = await this.ensureAuth().apiCall('drafts.list', {
|
|
780
829
|
cursor,
|
|
781
830
|
})
|
|
782
831
|
this.checkResponse(response)
|
|
@@ -795,4 +844,576 @@ export class SlackClient {
|
|
|
795
844
|
}
|
|
796
845
|
})
|
|
797
846
|
}
|
|
847
|
+
|
|
848
|
+
async rtmConnect(): Promise<{ url: string; cookie: string; self: { id: string }; team: { id: string } }> {
|
|
849
|
+
return this.withRetry(async () => {
|
|
850
|
+
const response = await this.ensureAuth().apiCall('rtm.connect')
|
|
851
|
+
this.checkResponse(response)
|
|
852
|
+
return {
|
|
853
|
+
url: (response as any).url,
|
|
854
|
+
cookie: this.cookie!,
|
|
855
|
+
self: { id: (response as any).self.id },
|
|
856
|
+
team: { id: (response as any).team.id },
|
|
857
|
+
}
|
|
858
|
+
})
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
async pinMessage(channel: string, ts: string): Promise<void> {
|
|
862
|
+
return this.withRetry(async () => {
|
|
863
|
+
const response = await this.ensureAuth().pins.add({ channel, timestamp: ts })
|
|
864
|
+
this.checkResponse(response)
|
|
865
|
+
})
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
async unpinMessage(channel: string, ts: string): Promise<void> {
|
|
869
|
+
return this.withRetry(async () => {
|
|
870
|
+
const response = await this.ensureAuth().pins.remove({ channel, timestamp: ts })
|
|
871
|
+
this.checkResponse(response)
|
|
872
|
+
})
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
async listPins(channel: string): Promise<SlackPin[]> {
|
|
876
|
+
return this.withRetry(async () => {
|
|
877
|
+
const response = await this.ensureAuth().pins.list({ channel })
|
|
878
|
+
this.checkResponse(response)
|
|
879
|
+
|
|
880
|
+
return ((response as any).items || [])
|
|
881
|
+
.filter((item: any) => item.message)
|
|
882
|
+
.map((item: any) => ({
|
|
883
|
+
channel,
|
|
884
|
+
message: {
|
|
885
|
+
ts: item.message.ts || '',
|
|
886
|
+
text: item.message.text || '',
|
|
887
|
+
user: item.message.user,
|
|
888
|
+
username: item.message.username,
|
|
889
|
+
type: item.message.type || 'message',
|
|
890
|
+
thread_ts: item.message.thread_ts,
|
|
891
|
+
reply_count: item.message.reply_count,
|
|
892
|
+
},
|
|
893
|
+
date_created: item.created || 0,
|
|
894
|
+
created_by: item.created_by || '',
|
|
895
|
+
}))
|
|
896
|
+
})
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
async addBookmark(
|
|
900
|
+
channel: string,
|
|
901
|
+
title: string,
|
|
902
|
+
link: string,
|
|
903
|
+
options?: { type?: string; emoji?: string },
|
|
904
|
+
): Promise<SlackBookmark> {
|
|
905
|
+
return this.withRetry(async () => {
|
|
906
|
+
const response = await this.ensureAuth().apiCall('bookmarks.add', {
|
|
907
|
+
channel_id: channel,
|
|
908
|
+
title,
|
|
909
|
+
link,
|
|
910
|
+
type: options?.type || 'link',
|
|
911
|
+
emoji: options?.emoji,
|
|
912
|
+
})
|
|
913
|
+
this.checkResponse(response)
|
|
914
|
+
|
|
915
|
+
const b = (response as any).bookmark
|
|
916
|
+
return {
|
|
917
|
+
id: b.id || '',
|
|
918
|
+
channel_id: b.channel_id || channel,
|
|
919
|
+
title: b.title || title,
|
|
920
|
+
link: b.link || link,
|
|
921
|
+
emoji: b.emoji,
|
|
922
|
+
icon_url: b.icon_url,
|
|
923
|
+
type: b.type || 'link',
|
|
924
|
+
date_created: b.date_created || 0,
|
|
925
|
+
date_updated: b.date_updated || 0,
|
|
926
|
+
created_by: b.created_by || '',
|
|
927
|
+
}
|
|
928
|
+
})
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
async editBookmark(
|
|
932
|
+
channel: string,
|
|
933
|
+
bookmarkId: string,
|
|
934
|
+
options: Partial<Pick<SlackBookmark, 'title' | 'link' | 'emoji'>>,
|
|
935
|
+
): Promise<SlackBookmark> {
|
|
936
|
+
return this.withRetry(async () => {
|
|
937
|
+
const response = await this.ensureAuth().apiCall('bookmarks.edit', {
|
|
938
|
+
channel_id: channel,
|
|
939
|
+
bookmark_id: bookmarkId,
|
|
940
|
+
...options,
|
|
941
|
+
})
|
|
942
|
+
this.checkResponse(response)
|
|
943
|
+
|
|
944
|
+
const b = (response as any).bookmark
|
|
945
|
+
return {
|
|
946
|
+
id: b.id || bookmarkId,
|
|
947
|
+
channel_id: b.channel_id || channel,
|
|
948
|
+
title: b.title || '',
|
|
949
|
+
link: b.link || '',
|
|
950
|
+
emoji: b.emoji,
|
|
951
|
+
icon_url: b.icon_url,
|
|
952
|
+
type: b.type || 'link',
|
|
953
|
+
date_created: b.date_created || 0,
|
|
954
|
+
date_updated: b.date_updated || 0,
|
|
955
|
+
created_by: b.created_by || '',
|
|
956
|
+
}
|
|
957
|
+
})
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
async removeBookmark(channel: string, bookmarkId: string): Promise<void> {
|
|
961
|
+
return this.withRetry(async () => {
|
|
962
|
+
const response = await this.ensureAuth().apiCall('bookmarks.remove', {
|
|
963
|
+
channel_id: channel,
|
|
964
|
+
bookmark_id: bookmarkId,
|
|
965
|
+
})
|
|
966
|
+
this.checkResponse(response)
|
|
967
|
+
})
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
async listBookmarks(channel: string): Promise<SlackBookmark[]> {
|
|
971
|
+
return this.withRetry(async () => {
|
|
972
|
+
const response = await this.ensureAuth().apiCall('bookmarks.list', { channel_id: channel })
|
|
973
|
+
this.checkResponse(response)
|
|
974
|
+
|
|
975
|
+
return ((response as any).bookmarks || []).map((b: any) => ({
|
|
976
|
+
id: b.id || '',
|
|
977
|
+
channel_id: b.channel_id || channel,
|
|
978
|
+
title: b.title || '',
|
|
979
|
+
link: b.link || '',
|
|
980
|
+
emoji: b.emoji,
|
|
981
|
+
icon_url: b.icon_url,
|
|
982
|
+
type: b.type || 'link',
|
|
983
|
+
date_created: b.date_created || 0,
|
|
984
|
+
date_updated: b.date_updated || 0,
|
|
985
|
+
created_by: b.created_by || '',
|
|
986
|
+
}))
|
|
987
|
+
})
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
async scheduleMessage(channel: string, text: string, postAt: number, threadTs?: string): Promise<SlackScheduledMessage> {
|
|
991
|
+
return this.withRetry(async () => {
|
|
992
|
+
const response = await this.ensureAuth().chat.scheduleMessage({
|
|
993
|
+
channel,
|
|
994
|
+
text,
|
|
995
|
+
post_at: postAt,
|
|
996
|
+
thread_ts: threadTs,
|
|
997
|
+
})
|
|
998
|
+
this.checkResponse(response)
|
|
999
|
+
|
|
1000
|
+
return {
|
|
1001
|
+
id: (response as any).scheduled_message_id || '',
|
|
1002
|
+
channel_id: channel,
|
|
1003
|
+
post_at: postAt,
|
|
1004
|
+
date_created: Math.floor(Date.now() / 1000),
|
|
1005
|
+
text,
|
|
1006
|
+
}
|
|
1007
|
+
})
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
async listScheduledMessages(channel?: string): Promise<SlackScheduledMessage[]> {
|
|
1011
|
+
return this.withRetry(async () => {
|
|
1012
|
+
const allMessages: SlackScheduledMessage[] = []
|
|
1013
|
+
let cursor: string | undefined
|
|
1014
|
+
|
|
1015
|
+
do {
|
|
1016
|
+
const response = await (this.ensureAuth().chat.scheduledMessages.list as any)({
|
|
1017
|
+
...(channel ? { channel } : {}),
|
|
1018
|
+
...(cursor ? { cursor } : {}),
|
|
1019
|
+
})
|
|
1020
|
+
this.checkResponse(response)
|
|
1021
|
+
|
|
1022
|
+
const messages = ((response as any).scheduled_messages || []).map((msg: any) => ({
|
|
1023
|
+
id: msg.id || msg.scheduled_message_id || '',
|
|
1024
|
+
channel_id: msg.channel_id || '',
|
|
1025
|
+
post_at: msg.post_at || 0,
|
|
1026
|
+
date_created: msg.date_created || 0,
|
|
1027
|
+
text: msg.text || '',
|
|
1028
|
+
}))
|
|
1029
|
+
allMessages.push(...messages)
|
|
1030
|
+
cursor = (response as any).response_metadata?.next_cursor
|
|
1031
|
+
} while (cursor)
|
|
1032
|
+
|
|
1033
|
+
return allMessages
|
|
1034
|
+
})
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
async deleteScheduledMessage(channel: string, scheduledMessageId: string): Promise<void> {
|
|
1038
|
+
return this.withRetry(async () => {
|
|
1039
|
+
const response = await this.ensureAuth().chat.deleteScheduledMessage({
|
|
1040
|
+
channel,
|
|
1041
|
+
scheduled_message_id: scheduledMessageId,
|
|
1042
|
+
})
|
|
1043
|
+
this.checkResponse(response)
|
|
1044
|
+
})
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
async createChannel(name: string, isPrivate?: boolean): Promise<SlackChannel> {
|
|
1048
|
+
return this.withRetry(async () => {
|
|
1049
|
+
const response = await this.ensureAuth().conversations.create({ name, is_private: isPrivate })
|
|
1050
|
+
this.checkResponse(response)
|
|
1051
|
+
|
|
1052
|
+
const ch = response.channel!
|
|
1053
|
+
return {
|
|
1054
|
+
id: ch.id!,
|
|
1055
|
+
name: ch.name!,
|
|
1056
|
+
is_private: ch.is_private || false,
|
|
1057
|
+
is_archived: ch.is_archived || false,
|
|
1058
|
+
created: ch.created || 0,
|
|
1059
|
+
creator: ch.creator || '',
|
|
1060
|
+
topic: ch.topic
|
|
1061
|
+
? {
|
|
1062
|
+
value: ch.topic.value || '',
|
|
1063
|
+
creator: ch.topic.creator || '',
|
|
1064
|
+
last_set: ch.topic.last_set || 0,
|
|
1065
|
+
}
|
|
1066
|
+
: undefined,
|
|
1067
|
+
purpose: ch.purpose
|
|
1068
|
+
? {
|
|
1069
|
+
value: ch.purpose.value || '',
|
|
1070
|
+
creator: ch.purpose.creator || '',
|
|
1071
|
+
last_set: ch.purpose.last_set || 0,
|
|
1072
|
+
}
|
|
1073
|
+
: undefined,
|
|
1074
|
+
}
|
|
1075
|
+
})
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
async archiveChannel(channel: string): Promise<void> {
|
|
1079
|
+
return this.withRetry(async () => {
|
|
1080
|
+
const response = await this.ensureAuth().conversations.archive({ channel })
|
|
1081
|
+
this.checkResponse(response)
|
|
1082
|
+
})
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
async setChannelTopic(channel: string, topic: string): Promise<{ topic: string }> {
|
|
1086
|
+
return this.withRetry(async () => {
|
|
1087
|
+
const response = await this.ensureAuth().conversations.setTopic({ channel, topic })
|
|
1088
|
+
this.checkResponse(response)
|
|
1089
|
+
return { topic: (response as any).topic || topic }
|
|
1090
|
+
})
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
async setChannelPurpose(channel: string, purpose: string): Promise<{ purpose: string }> {
|
|
1094
|
+
return this.withRetry(async () => {
|
|
1095
|
+
const response = await this.ensureAuth().conversations.setPurpose({ channel, purpose })
|
|
1096
|
+
this.checkResponse(response)
|
|
1097
|
+
return { purpose: (response as any).purpose || purpose }
|
|
1098
|
+
})
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
async inviteToChannel(channel: string, users: string): Promise<SlackChannel> {
|
|
1102
|
+
return this.withRetry(async () => {
|
|
1103
|
+
const response = await this.ensureAuth().conversations.invite({ channel, users })
|
|
1104
|
+
this.checkResponse(response)
|
|
1105
|
+
|
|
1106
|
+
const ch = response.channel!
|
|
1107
|
+
return {
|
|
1108
|
+
id: ch.id!,
|
|
1109
|
+
name: ch.name!,
|
|
1110
|
+
is_private: ch.is_private || false,
|
|
1111
|
+
is_archived: ch.is_archived || false,
|
|
1112
|
+
created: ch.created || 0,
|
|
1113
|
+
creator: ch.creator || '',
|
|
1114
|
+
}
|
|
1115
|
+
})
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
async joinChannel(channel: string): Promise<SlackChannel> {
|
|
1119
|
+
return this.withRetry(async () => {
|
|
1120
|
+
const response = await this.ensureAuth().conversations.join({ channel })
|
|
1121
|
+
this.checkResponse(response)
|
|
1122
|
+
|
|
1123
|
+
const ch = response.channel!
|
|
1124
|
+
return {
|
|
1125
|
+
id: ch.id!,
|
|
1126
|
+
name: ch.name!,
|
|
1127
|
+
is_private: ch.is_private || false,
|
|
1128
|
+
is_archived: ch.is_archived || false,
|
|
1129
|
+
created: ch.created || 0,
|
|
1130
|
+
creator: ch.creator || '',
|
|
1131
|
+
}
|
|
1132
|
+
})
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
async leaveChannel(channel: string): Promise<void> {
|
|
1136
|
+
return this.withRetry(async () => {
|
|
1137
|
+
const response = await this.ensureAuth().conversations.leave({ channel })
|
|
1138
|
+
this.checkResponse(response)
|
|
1139
|
+
})
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
async lookupUserByEmail(email: string): Promise<SlackUser> {
|
|
1143
|
+
return this.withRetry(async () => {
|
|
1144
|
+
const response = await this.ensureAuth().users.lookupByEmail({ email })
|
|
1145
|
+
this.checkResponse(response)
|
|
1146
|
+
|
|
1147
|
+
const member = response.user!
|
|
1148
|
+
return {
|
|
1149
|
+
id: member.id!,
|
|
1150
|
+
name: member.name!,
|
|
1151
|
+
real_name: member.real_name || member.name || '',
|
|
1152
|
+
is_admin: member.is_admin || false,
|
|
1153
|
+
is_owner: member.is_owner || false,
|
|
1154
|
+
is_bot: member.is_bot || false,
|
|
1155
|
+
is_app_user: member.is_app_user || false,
|
|
1156
|
+
profile: member.profile
|
|
1157
|
+
? {
|
|
1158
|
+
email: member.profile.email,
|
|
1159
|
+
phone: member.profile.phone,
|
|
1160
|
+
title: member.profile.title,
|
|
1161
|
+
status_text: member.profile.status_text,
|
|
1162
|
+
}
|
|
1163
|
+
: undefined,
|
|
1164
|
+
}
|
|
1165
|
+
})
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
async getUserProfile(userId: string): Promise<SlackUserProfile> {
|
|
1169
|
+
return this.withRetry(async () => {
|
|
1170
|
+
const response = await this.ensureAuth().users.profile.get({ user: userId })
|
|
1171
|
+
this.checkResponse(response)
|
|
1172
|
+
|
|
1173
|
+
const p = (response as any).profile || {}
|
|
1174
|
+
return {
|
|
1175
|
+
title: p.title,
|
|
1176
|
+
phone: p.phone,
|
|
1177
|
+
skype: p.skype,
|
|
1178
|
+
real_name: p.real_name,
|
|
1179
|
+
real_name_normalized: p.real_name_normalized,
|
|
1180
|
+
display_name: p.display_name,
|
|
1181
|
+
display_name_normalized: p.display_name_normalized,
|
|
1182
|
+
status_text: p.status_text,
|
|
1183
|
+
status_emoji: p.status_emoji,
|
|
1184
|
+
status_expiration: p.status_expiration,
|
|
1185
|
+
email: p.email,
|
|
1186
|
+
first_name: p.first_name,
|
|
1187
|
+
last_name: p.last_name,
|
|
1188
|
+
image_24: p.image_24,
|
|
1189
|
+
image_32: p.image_32,
|
|
1190
|
+
image_48: p.image_48,
|
|
1191
|
+
image_72: p.image_72,
|
|
1192
|
+
image_192: p.image_192,
|
|
1193
|
+
image_512: p.image_512,
|
|
1194
|
+
}
|
|
1195
|
+
})
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
async setUserProfile(profile: SlackUserProfile): Promise<SlackUserProfile> {
|
|
1199
|
+
return this.withRetry(async () => {
|
|
1200
|
+
const response = await this.ensureAuth().users.profile.set({ profile: profile as any })
|
|
1201
|
+
this.checkResponse(response)
|
|
1202
|
+
|
|
1203
|
+
const p = (response as any).profile || {}
|
|
1204
|
+
return {
|
|
1205
|
+
title: p.title,
|
|
1206
|
+
phone: p.phone,
|
|
1207
|
+
skype: p.skype,
|
|
1208
|
+
real_name: p.real_name,
|
|
1209
|
+
real_name_normalized: p.real_name_normalized,
|
|
1210
|
+
display_name: p.display_name,
|
|
1211
|
+
display_name_normalized: p.display_name_normalized,
|
|
1212
|
+
status_text: p.status_text,
|
|
1213
|
+
status_emoji: p.status_emoji,
|
|
1214
|
+
status_expiration: p.status_expiration,
|
|
1215
|
+
email: p.email,
|
|
1216
|
+
first_name: p.first_name,
|
|
1217
|
+
last_name: p.last_name,
|
|
1218
|
+
image_24: p.image_24,
|
|
1219
|
+
image_32: p.image_32,
|
|
1220
|
+
image_48: p.image_48,
|
|
1221
|
+
image_72: p.image_72,
|
|
1222
|
+
image_192: p.image_192,
|
|
1223
|
+
image_512: p.image_512,
|
|
1224
|
+
}
|
|
1225
|
+
})
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
async postEphemeral(channel: string, user: string, text: string): Promise<string> {
|
|
1229
|
+
return this.withRetry(async () => {
|
|
1230
|
+
const response = await this.ensureAuth().chat.postEphemeral({ channel, user, text })
|
|
1231
|
+
this.checkResponse(response)
|
|
1232
|
+
return (response as any).message_ts || ''
|
|
1233
|
+
})
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
async getPermalink(channel: string, ts: string): Promise<string> {
|
|
1237
|
+
return this.withRetry(async () => {
|
|
1238
|
+
const response = await this.ensureAuth().chat.getPermalink({ channel, message_ts: ts })
|
|
1239
|
+
this.checkResponse(response)
|
|
1240
|
+
return (response as any).permalink || ''
|
|
1241
|
+
})
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
async addReminder(text: string, time: number, options?: { user?: string }): Promise<SlackReminder> {
|
|
1245
|
+
return this.withRetry(async () => {
|
|
1246
|
+
const response = await this.ensureAuth().reminders.add({ text, time: time as any, user: options?.user })
|
|
1247
|
+
this.checkResponse(response)
|
|
1248
|
+
|
|
1249
|
+
const r = (response as any).reminder || {}
|
|
1250
|
+
return {
|
|
1251
|
+
id: r.id || '',
|
|
1252
|
+
creator: r.creator || '',
|
|
1253
|
+
text: r.text || text,
|
|
1254
|
+
user: r.user || '',
|
|
1255
|
+
recurring: r.recurring || false,
|
|
1256
|
+
time: r.time || time,
|
|
1257
|
+
complete_ts: r.complete_ts || 0,
|
|
1258
|
+
}
|
|
1259
|
+
})
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
async listReminders(): Promise<SlackReminder[]> {
|
|
1263
|
+
return this.withRetry(async () => {
|
|
1264
|
+
const response = await this.ensureAuth().reminders.list({})
|
|
1265
|
+
this.checkResponse(response)
|
|
1266
|
+
|
|
1267
|
+
return ((response as any).reminders || []).map((r: any) => ({
|
|
1268
|
+
id: r.id || '',
|
|
1269
|
+
creator: r.creator || '',
|
|
1270
|
+
text: r.text || '',
|
|
1271
|
+
user: r.user || '',
|
|
1272
|
+
recurring: r.recurring || false,
|
|
1273
|
+
time: r.time || 0,
|
|
1274
|
+
complete_ts: r.complete_ts || 0,
|
|
1275
|
+
}))
|
|
1276
|
+
})
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
async completeReminder(reminderId: string): Promise<void> {
|
|
1280
|
+
return this.withRetry(async () => {
|
|
1281
|
+
const response = await this.ensureAuth().reminders.complete({ reminder: reminderId })
|
|
1282
|
+
this.checkResponse(response)
|
|
1283
|
+
})
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
async deleteReminder(reminderId: string): Promise<void> {
|
|
1287
|
+
return this.withRetry(async () => {
|
|
1288
|
+
const response = await this.ensureAuth().reminders.delete({ reminder: reminderId })
|
|
1289
|
+
this.checkResponse(response)
|
|
1290
|
+
})
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
async deleteFile(fileId: string): Promise<void> {
|
|
1294
|
+
return this.withRetry(async () => {
|
|
1295
|
+
const response = await this.ensureAuth().files.delete({ file: fileId })
|
|
1296
|
+
this.checkResponse(response)
|
|
1297
|
+
})
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
async listEmoji(): Promise<Record<string, string>> {
|
|
1301
|
+
return this.withRetry(async () => {
|
|
1302
|
+
const response = await this.ensureAuth().emoji.list({})
|
|
1303
|
+
this.checkResponse(response)
|
|
1304
|
+
return ((response as any).emoji || {}) as Record<string, string>
|
|
1305
|
+
})
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
private mapUsergroup(ug: any): SlackUsergroup {
|
|
1309
|
+
return {
|
|
1310
|
+
id: ug.id || '',
|
|
1311
|
+
team_id: ug.team_id || '',
|
|
1312
|
+
name: ug.name || '',
|
|
1313
|
+
handle: ug.handle || '',
|
|
1314
|
+
description: ug.description || '',
|
|
1315
|
+
is_external: ug.is_external ?? false,
|
|
1316
|
+
is_usergroup: ug.is_usergroup ?? true,
|
|
1317
|
+
date_create: ug.date_create ?? 0,
|
|
1318
|
+
date_update: ug.date_update ?? 0,
|
|
1319
|
+
date_delete: ug.date_delete ?? 0,
|
|
1320
|
+
auto_type: ug.auto_type ?? null,
|
|
1321
|
+
created_by: ug.created_by || '',
|
|
1322
|
+
updated_by: ug.updated_by || '',
|
|
1323
|
+
deleted_by: ug.deleted_by ?? null,
|
|
1324
|
+
prefs: {
|
|
1325
|
+
channels: ug.prefs?.channels || [],
|
|
1326
|
+
groups: ug.prefs?.groups || [],
|
|
1327
|
+
},
|
|
1328
|
+
users: ug.users || [],
|
|
1329
|
+
user_count: ug.user_count ?? 0,
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
async listUsergroups(options?: { includeDisabled?: boolean; includeUsers?: boolean; includeCount?: boolean }): Promise<SlackUsergroup[]> {
|
|
1334
|
+
return this.withRetry(async () => {
|
|
1335
|
+
const response = await this.ensureAuth().apiCall('usergroups.list', {
|
|
1336
|
+
include_disabled: options?.includeDisabled,
|
|
1337
|
+
include_users: options?.includeUsers,
|
|
1338
|
+
include_count: options?.includeCount,
|
|
1339
|
+
})
|
|
1340
|
+
this.checkResponse(response)
|
|
1341
|
+
return ((response as any).usergroups || []).map((ug: any) => this.mapUsergroup(ug))
|
|
1342
|
+
})
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
async createUsergroup(
|
|
1346
|
+
name: string,
|
|
1347
|
+
options?: { handle?: string; description?: string; channels?: string[] },
|
|
1348
|
+
): Promise<SlackUsergroup> {
|
|
1349
|
+
return this.withRetry(async () => {
|
|
1350
|
+
const response = await this.ensureAuth().apiCall('usergroups.create', {
|
|
1351
|
+
name,
|
|
1352
|
+
handle: options?.handle,
|
|
1353
|
+
description: options?.description,
|
|
1354
|
+
channels: options?.channels?.join(','),
|
|
1355
|
+
})
|
|
1356
|
+
this.checkResponse(response)
|
|
1357
|
+
return this.mapUsergroup((response as any).usergroup)
|
|
1358
|
+
})
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
async updateUsergroup(
|
|
1362
|
+
usergroupId: string,
|
|
1363
|
+
options: { name?: string; handle?: string; description?: string; channels?: string[] },
|
|
1364
|
+
): Promise<SlackUsergroup> {
|
|
1365
|
+
return this.withRetry(async () => {
|
|
1366
|
+
const response = await this.ensureAuth().apiCall('usergroups.update', {
|
|
1367
|
+
usergroup: usergroupId,
|
|
1368
|
+
name: options.name,
|
|
1369
|
+
handle: options.handle,
|
|
1370
|
+
description: options.description,
|
|
1371
|
+
channels: options.channels?.join(','),
|
|
1372
|
+
})
|
|
1373
|
+
this.checkResponse(response)
|
|
1374
|
+
return this.mapUsergroup((response as any).usergroup)
|
|
1375
|
+
})
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
async disableUsergroup(usergroupId: string): Promise<SlackUsergroup> {
|
|
1379
|
+
return this.withRetry(async () => {
|
|
1380
|
+
const response = await this.ensureAuth().apiCall('usergroups.disable', {
|
|
1381
|
+
usergroup: usergroupId,
|
|
1382
|
+
})
|
|
1383
|
+
this.checkResponse(response)
|
|
1384
|
+
return this.mapUsergroup((response as any).usergroup)
|
|
1385
|
+
})
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
async enableUsergroup(usergroupId: string): Promise<SlackUsergroup> {
|
|
1389
|
+
return this.withRetry(async () => {
|
|
1390
|
+
const response = await this.ensureAuth().apiCall('usergroups.enable', {
|
|
1391
|
+
usergroup: usergroupId,
|
|
1392
|
+
})
|
|
1393
|
+
this.checkResponse(response)
|
|
1394
|
+
return this.mapUsergroup((response as any).usergroup)
|
|
1395
|
+
})
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
async listUsergroupMembers(usergroupId: string, options?: { includeDisabled?: boolean }): Promise<string[]> {
|
|
1399
|
+
return this.withRetry(async () => {
|
|
1400
|
+
const response = await this.ensureAuth().apiCall('usergroups.users.list', {
|
|
1401
|
+
usergroup: usergroupId,
|
|
1402
|
+
include_disabled: options?.includeDisabled,
|
|
1403
|
+
})
|
|
1404
|
+
this.checkResponse(response)
|
|
1405
|
+
return (response as any).users || []
|
|
1406
|
+
})
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
async updateUsergroupMembers(usergroupId: string, users: string[]): Promise<SlackUsergroup> {
|
|
1410
|
+
return this.withRetry(async () => {
|
|
1411
|
+
const response = await this.ensureAuth().apiCall('usergroups.users.update', {
|
|
1412
|
+
usergroup: usergroupId,
|
|
1413
|
+
users: users.join(','),
|
|
1414
|
+
})
|
|
1415
|
+
this.checkResponse(response)
|
|
1416
|
+
return this.mapUsergroup((response as any).usergroup)
|
|
1417
|
+
})
|
|
1418
|
+
}
|
|
798
1419
|
}
|