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
|
@@ -10,21 +10,39 @@ export class SlackError extends Error {
|
|
|
10
10
|
const MAX_RETRIES = 3;
|
|
11
11
|
const RATE_LIMIT_ERROR_CODE = 'slack_webapi_rate_limited_error';
|
|
12
12
|
export class SlackClient {
|
|
13
|
-
client;
|
|
14
|
-
token;
|
|
15
|
-
cookie;
|
|
16
|
-
|
|
17
|
-
if (
|
|
18
|
-
|
|
13
|
+
client = null;
|
|
14
|
+
token = null;
|
|
15
|
+
cookie = null;
|
|
16
|
+
async login(credentials) {
|
|
17
|
+
if (credentials) {
|
|
18
|
+
if (!credentials.token) {
|
|
19
|
+
throw new SlackError('Token is required', 'missing_token');
|
|
20
|
+
}
|
|
21
|
+
if (!credentials.cookie) {
|
|
22
|
+
throw new SlackError('Cookie is required', 'missing_cookie');
|
|
23
|
+
}
|
|
24
|
+
this.token = credentials.token;
|
|
25
|
+
this.cookie = credentials.cookie;
|
|
26
|
+
this.client = new WebClient(credentials.token, {
|
|
27
|
+
headers: { Cookie: `d=${credentials.cookie}` },
|
|
28
|
+
});
|
|
29
|
+
return this;
|
|
19
30
|
}
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
const { ensureSlackAuth } = await import('./ensure-auth.js');
|
|
32
|
+
await ensureSlackAuth();
|
|
33
|
+
const { SlackCredentialManager } = await import('./credential-manager.js');
|
|
34
|
+
const credManager = new SlackCredentialManager();
|
|
35
|
+
const workspace = await credManager.getWorkspace();
|
|
36
|
+
if (!workspace) {
|
|
37
|
+
throw new SlackError('No workspace credentials found. Make sure Slack desktop app is installed and logged in.', 'no_credentials');
|
|
22
38
|
}
|
|
23
|
-
this.token
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
39
|
+
return this.login({ token: workspace.token, cookie: workspace.cookie });
|
|
40
|
+
}
|
|
41
|
+
ensureAuth() {
|
|
42
|
+
if (!this.client) {
|
|
43
|
+
throw new SlackError('Not authenticated. Call .login() first.', 'not_authenticated');
|
|
44
|
+
}
|
|
45
|
+
return this.client;
|
|
28
46
|
}
|
|
29
47
|
async withRetry(operation) {
|
|
30
48
|
let lastError;
|
|
@@ -54,7 +72,7 @@ export class SlackClient {
|
|
|
54
72
|
}
|
|
55
73
|
async testAuth() {
|
|
56
74
|
return this.withRetry(async () => {
|
|
57
|
-
const response = await this.
|
|
75
|
+
const response = await this.ensureAuth().auth.test();
|
|
58
76
|
this.checkResponse(response);
|
|
59
77
|
return {
|
|
60
78
|
user_id: response.user_id,
|
|
@@ -69,7 +87,7 @@ export class SlackClient {
|
|
|
69
87
|
const channels = [];
|
|
70
88
|
let cursor;
|
|
71
89
|
do {
|
|
72
|
-
const response = await this.
|
|
90
|
+
const response = await this.ensureAuth().conversations.list({
|
|
73
91
|
cursor,
|
|
74
92
|
limit: 200,
|
|
75
93
|
types: 'public_channel,private_channel',
|
|
@@ -111,7 +129,7 @@ export class SlackClient {
|
|
|
111
129
|
const dms = [];
|
|
112
130
|
let cursor;
|
|
113
131
|
do {
|
|
114
|
-
const response = await this.
|
|
132
|
+
const response = await this.ensureAuth().conversations.list({
|
|
115
133
|
cursor,
|
|
116
134
|
limit: 200,
|
|
117
135
|
types: 'im,mpim',
|
|
@@ -134,7 +152,7 @@ export class SlackClient {
|
|
|
134
152
|
}
|
|
135
153
|
async getChannel(id) {
|
|
136
154
|
return this.withRetry(async () => {
|
|
137
|
-
const response = await this.
|
|
155
|
+
const response = await this.ensureAuth().conversations.info({ channel: id });
|
|
138
156
|
this.checkResponse(response);
|
|
139
157
|
const ch = response.channel;
|
|
140
158
|
return {
|
|
@@ -176,7 +194,7 @@ export class SlackClient {
|
|
|
176
194
|
}
|
|
177
195
|
async sendMessage(channel, text, threadTs) {
|
|
178
196
|
return this.withRetry(async () => {
|
|
179
|
-
const response = await this.
|
|
197
|
+
const response = await this.ensureAuth().chat.postMessage({
|
|
180
198
|
channel,
|
|
181
199
|
text,
|
|
182
200
|
thread_ts: threadTs,
|
|
@@ -192,11 +210,15 @@ export class SlackClient {
|
|
|
192
210
|
};
|
|
193
211
|
});
|
|
194
212
|
}
|
|
195
|
-
async getMessages(channel,
|
|
213
|
+
async getMessages(channel, limitOrOptions) {
|
|
214
|
+
const options = typeof limitOrOptions === 'number' ? { limit: limitOrOptions } : (limitOrOptions ?? {});
|
|
215
|
+
const { limit = 20, oldest, latest } = options;
|
|
196
216
|
return this.withRetry(async () => {
|
|
197
|
-
const response = await this.
|
|
217
|
+
const response = await this.ensureAuth().conversations.history({
|
|
198
218
|
channel,
|
|
199
219
|
limit,
|
|
220
|
+
oldest,
|
|
221
|
+
latest,
|
|
200
222
|
});
|
|
201
223
|
this.checkResponse(response);
|
|
202
224
|
return (response.messages || []).map((msg) => ({
|
|
@@ -231,7 +253,7 @@ export class SlackClient {
|
|
|
231
253
|
}
|
|
232
254
|
async getMessage(channel, ts) {
|
|
233
255
|
return this.withRetry(async () => {
|
|
234
|
-
const response = await this.
|
|
256
|
+
const response = await this.ensureAuth().conversations.history({
|
|
235
257
|
channel,
|
|
236
258
|
oldest: ts,
|
|
237
259
|
inclusive: true,
|
|
@@ -274,7 +296,7 @@ export class SlackClient {
|
|
|
274
296
|
}
|
|
275
297
|
async updateMessage(channel, ts, text) {
|
|
276
298
|
return this.withRetry(async () => {
|
|
277
|
-
const response = await this.
|
|
299
|
+
const response = await this.ensureAuth().chat.update({
|
|
278
300
|
channel,
|
|
279
301
|
ts,
|
|
280
302
|
text,
|
|
@@ -291,7 +313,7 @@ export class SlackClient {
|
|
|
291
313
|
}
|
|
292
314
|
async deleteMessage(channel, ts) {
|
|
293
315
|
return this.withRetry(async () => {
|
|
294
|
-
const response = await this.
|
|
316
|
+
const response = await this.ensureAuth().chat.delete({
|
|
295
317
|
channel,
|
|
296
318
|
ts,
|
|
297
319
|
});
|
|
@@ -300,7 +322,7 @@ export class SlackClient {
|
|
|
300
322
|
}
|
|
301
323
|
async addReaction(channel, ts, emoji) {
|
|
302
324
|
return this.withRetry(async () => {
|
|
303
|
-
const response = await this.
|
|
325
|
+
const response = await this.ensureAuth().reactions.add({
|
|
304
326
|
channel,
|
|
305
327
|
timestamp: ts,
|
|
306
328
|
name: emoji,
|
|
@@ -310,7 +332,7 @@ export class SlackClient {
|
|
|
310
332
|
}
|
|
311
333
|
async removeReaction(channel, ts, emoji) {
|
|
312
334
|
return this.withRetry(async () => {
|
|
313
|
-
const response = await this.
|
|
335
|
+
const response = await this.ensureAuth().reactions.remove({
|
|
314
336
|
channel,
|
|
315
337
|
timestamp: ts,
|
|
316
338
|
name: emoji,
|
|
@@ -323,7 +345,7 @@ export class SlackClient {
|
|
|
323
345
|
const users = [];
|
|
324
346
|
let cursor;
|
|
325
347
|
do {
|
|
326
|
-
const response = await this.
|
|
348
|
+
const response = await this.ensureAuth().users.list({
|
|
327
349
|
cursor,
|
|
328
350
|
limit: 200,
|
|
329
351
|
});
|
|
@@ -359,7 +381,7 @@ export class SlackClient {
|
|
|
359
381
|
const members = [];
|
|
360
382
|
let cursor;
|
|
361
383
|
do {
|
|
362
|
-
const response = await this.
|
|
384
|
+
const response = await this.ensureAuth().conversations.members({
|
|
363
385
|
channel,
|
|
364
386
|
cursor,
|
|
365
387
|
limit: 200,
|
|
@@ -375,7 +397,7 @@ export class SlackClient {
|
|
|
375
397
|
}
|
|
376
398
|
async getUser(id) {
|
|
377
399
|
return this.withRetry(async () => {
|
|
378
|
-
const response = await this.
|
|
400
|
+
const response = await this.ensureAuth().users.info({ user: id });
|
|
379
401
|
this.checkResponse(response);
|
|
380
402
|
const member = response.user;
|
|
381
403
|
return {
|
|
@@ -399,7 +421,7 @@ export class SlackClient {
|
|
|
399
421
|
}
|
|
400
422
|
async uploadFile(channels, file, filename) {
|
|
401
423
|
return this.withRetry(async () => {
|
|
402
|
-
const response = await this.
|
|
424
|
+
const response = await this.ensureAuth().files.uploadV2({
|
|
403
425
|
channel_id: channels[0],
|
|
404
426
|
file,
|
|
405
427
|
filename,
|
|
@@ -425,7 +447,7 @@ export class SlackClient {
|
|
|
425
447
|
}
|
|
426
448
|
async listFiles(channel) {
|
|
427
449
|
return this.withRetry(async () => {
|
|
428
|
-
const response = await this.
|
|
450
|
+
const response = await this.ensureAuth().files.list({
|
|
429
451
|
channel,
|
|
430
452
|
});
|
|
431
453
|
this.checkResponse(response);
|
|
@@ -444,7 +466,7 @@ export class SlackClient {
|
|
|
444
466
|
}
|
|
445
467
|
async getFileInfo(fileId) {
|
|
446
468
|
return this.withRetry(async () => {
|
|
447
|
-
const response = await this.
|
|
469
|
+
const response = await this.ensureAuth().files.info({ file: fileId });
|
|
448
470
|
this.checkResponse(response);
|
|
449
471
|
const f = response.file;
|
|
450
472
|
return {
|
|
@@ -465,6 +487,7 @@ export class SlackClient {
|
|
|
465
487
|
if (!file.url_private) {
|
|
466
488
|
throw new SlackError('File has no download URL', 'no_download_url');
|
|
467
489
|
}
|
|
490
|
+
this.ensureAuth();
|
|
468
491
|
const response = await fetch(file.url_private, {
|
|
469
492
|
headers: {
|
|
470
493
|
Authorization: `Bearer ${this.token}`,
|
|
@@ -482,7 +505,7 @@ export class SlackClient {
|
|
|
482
505
|
}
|
|
483
506
|
async searchMessages(query, options = {}) {
|
|
484
507
|
return this.withRetry(async () => {
|
|
485
|
-
const response = await this.
|
|
508
|
+
const response = await this.ensureAuth().search.messages({
|
|
486
509
|
query,
|
|
487
510
|
sort: options.sort || 'timestamp',
|
|
488
511
|
sort_dir: options.sortDir || 'desc',
|
|
@@ -505,7 +528,7 @@ export class SlackClient {
|
|
|
505
528
|
}
|
|
506
529
|
async getThreadReplies(channel, threadTs, options = {}) {
|
|
507
530
|
return this.withRetry(async () => {
|
|
508
|
-
const response = await this.
|
|
531
|
+
const response = await this.ensureAuth().conversations.replies({
|
|
509
532
|
channel,
|
|
510
533
|
ts: threadTs,
|
|
511
534
|
limit: options.limit || 100,
|
|
@@ -550,7 +573,7 @@ export class SlackClient {
|
|
|
550
573
|
}
|
|
551
574
|
async getUnreadCounts() {
|
|
552
575
|
return this.withRetry(async () => {
|
|
553
|
-
const response = await this.
|
|
576
|
+
const response = await this.ensureAuth().apiCall('client.counts');
|
|
554
577
|
this.checkResponse(response);
|
|
555
578
|
const channels = (response.channels || []).map((ch) => ({
|
|
556
579
|
id: ch.id || '',
|
|
@@ -567,7 +590,7 @@ export class SlackClient {
|
|
|
567
590
|
}
|
|
568
591
|
async getThreadView(channelId, ts) {
|
|
569
592
|
return this.withRetry(async () => {
|
|
570
|
-
const response = await this.
|
|
593
|
+
const response = await this.ensureAuth().subscriptions.thread.getView({
|
|
571
594
|
channel: channelId,
|
|
572
595
|
thread_ts: ts,
|
|
573
596
|
});
|
|
@@ -584,7 +607,7 @@ export class SlackClient {
|
|
|
584
607
|
}
|
|
585
608
|
async markRead(channelId, ts) {
|
|
586
609
|
return this.withRetry(async () => {
|
|
587
|
-
const response = await this.
|
|
610
|
+
const response = await this.ensureAuth().conversations.mark({
|
|
588
611
|
channel: channelId,
|
|
589
612
|
ts,
|
|
590
613
|
});
|
|
@@ -593,7 +616,7 @@ export class SlackClient {
|
|
|
593
616
|
}
|
|
594
617
|
async getActivityFeed(options) {
|
|
595
618
|
return this.withRetry(async () => {
|
|
596
|
-
const response = await this.
|
|
619
|
+
const response = await this.ensureAuth().apiCall('activity.feed', {
|
|
597
620
|
types: options?.types || 'thread_reply,message_reaction,at_user,at_channel,keyword',
|
|
598
621
|
mode: options?.mode || 'chrono_reads_and_unreads',
|
|
599
622
|
limit: options?.limit || 20,
|
|
@@ -613,7 +636,7 @@ export class SlackClient {
|
|
|
613
636
|
}
|
|
614
637
|
async getSavedItems(cursor) {
|
|
615
638
|
return this.withRetry(async () => {
|
|
616
|
-
const response = await this.
|
|
639
|
+
const response = await this.ensureAuth().apiCall('saved.list', {
|
|
617
640
|
cursor,
|
|
618
641
|
limit: 50,
|
|
619
642
|
});
|
|
@@ -651,7 +674,7 @@ export class SlackClient {
|
|
|
651
674
|
}
|
|
652
675
|
async getChannelSections() {
|
|
653
676
|
return this.withRetry(async () => {
|
|
654
|
-
const response = await this.
|
|
677
|
+
const response = await this.ensureAuth().apiCall('users.channelSections.list');
|
|
655
678
|
this.checkResponse(response);
|
|
656
679
|
const sections = response.channel_sections || [];
|
|
657
680
|
return sections.map((section) => ({
|
|
@@ -663,9 +686,19 @@ export class SlackClient {
|
|
|
663
686
|
}));
|
|
664
687
|
});
|
|
665
688
|
}
|
|
689
|
+
async openConversation(users) {
|
|
690
|
+
return this.withRetry(async () => {
|
|
691
|
+
const response = await this.ensureAuth().conversations.open({ users });
|
|
692
|
+
this.checkResponse(response);
|
|
693
|
+
return {
|
|
694
|
+
channel_id: response.channel.id,
|
|
695
|
+
already_open: response.already_open || false,
|
|
696
|
+
};
|
|
697
|
+
});
|
|
698
|
+
}
|
|
666
699
|
async getDrafts(cursor) {
|
|
667
700
|
return this.withRetry(async () => {
|
|
668
|
-
const response = await this.
|
|
701
|
+
const response = await this.ensureAuth().apiCall('drafts.list', {
|
|
669
702
|
cursor,
|
|
670
703
|
});
|
|
671
704
|
this.checkResponse(response);
|
|
@@ -682,5 +715,509 @@ export class SlackClient {
|
|
|
682
715
|
};
|
|
683
716
|
});
|
|
684
717
|
}
|
|
718
|
+
async rtmConnect() {
|
|
719
|
+
return this.withRetry(async () => {
|
|
720
|
+
const response = await this.ensureAuth().apiCall('rtm.connect');
|
|
721
|
+
this.checkResponse(response);
|
|
722
|
+
return {
|
|
723
|
+
url: response.url,
|
|
724
|
+
cookie: this.cookie,
|
|
725
|
+
self: { id: response.self.id },
|
|
726
|
+
team: { id: response.team.id },
|
|
727
|
+
};
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
async pinMessage(channel, ts) {
|
|
731
|
+
return this.withRetry(async () => {
|
|
732
|
+
const response = await this.ensureAuth().pins.add({ channel, timestamp: ts });
|
|
733
|
+
this.checkResponse(response);
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
async unpinMessage(channel, ts) {
|
|
737
|
+
return this.withRetry(async () => {
|
|
738
|
+
const response = await this.ensureAuth().pins.remove({ channel, timestamp: ts });
|
|
739
|
+
this.checkResponse(response);
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
async listPins(channel) {
|
|
743
|
+
return this.withRetry(async () => {
|
|
744
|
+
const response = await this.ensureAuth().pins.list({ channel });
|
|
745
|
+
this.checkResponse(response);
|
|
746
|
+
return (response.items || [])
|
|
747
|
+
.filter((item) => item.message)
|
|
748
|
+
.map((item) => ({
|
|
749
|
+
channel,
|
|
750
|
+
message: {
|
|
751
|
+
ts: item.message.ts || '',
|
|
752
|
+
text: item.message.text || '',
|
|
753
|
+
user: item.message.user,
|
|
754
|
+
username: item.message.username,
|
|
755
|
+
type: item.message.type || 'message',
|
|
756
|
+
thread_ts: item.message.thread_ts,
|
|
757
|
+
reply_count: item.message.reply_count,
|
|
758
|
+
},
|
|
759
|
+
date_created: item.created || 0,
|
|
760
|
+
created_by: item.created_by || '',
|
|
761
|
+
}));
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
async addBookmark(channel, title, link, options) {
|
|
765
|
+
return this.withRetry(async () => {
|
|
766
|
+
const response = await this.ensureAuth().apiCall('bookmarks.add', {
|
|
767
|
+
channel_id: channel,
|
|
768
|
+
title,
|
|
769
|
+
link,
|
|
770
|
+
type: options?.type || 'link',
|
|
771
|
+
emoji: options?.emoji,
|
|
772
|
+
});
|
|
773
|
+
this.checkResponse(response);
|
|
774
|
+
const b = response.bookmark;
|
|
775
|
+
return {
|
|
776
|
+
id: b.id || '',
|
|
777
|
+
channel_id: b.channel_id || channel,
|
|
778
|
+
title: b.title || title,
|
|
779
|
+
link: b.link || link,
|
|
780
|
+
emoji: b.emoji,
|
|
781
|
+
icon_url: b.icon_url,
|
|
782
|
+
type: b.type || 'link',
|
|
783
|
+
date_created: b.date_created || 0,
|
|
784
|
+
date_updated: b.date_updated || 0,
|
|
785
|
+
created_by: b.created_by || '',
|
|
786
|
+
};
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
async editBookmark(channel, bookmarkId, options) {
|
|
790
|
+
return this.withRetry(async () => {
|
|
791
|
+
const response = await this.ensureAuth().apiCall('bookmarks.edit', {
|
|
792
|
+
channel_id: channel,
|
|
793
|
+
bookmark_id: bookmarkId,
|
|
794
|
+
...options,
|
|
795
|
+
});
|
|
796
|
+
this.checkResponse(response);
|
|
797
|
+
const b = response.bookmark;
|
|
798
|
+
return {
|
|
799
|
+
id: b.id || bookmarkId,
|
|
800
|
+
channel_id: b.channel_id || channel,
|
|
801
|
+
title: b.title || '',
|
|
802
|
+
link: b.link || '',
|
|
803
|
+
emoji: b.emoji,
|
|
804
|
+
icon_url: b.icon_url,
|
|
805
|
+
type: b.type || 'link',
|
|
806
|
+
date_created: b.date_created || 0,
|
|
807
|
+
date_updated: b.date_updated || 0,
|
|
808
|
+
created_by: b.created_by || '',
|
|
809
|
+
};
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
async removeBookmark(channel, bookmarkId) {
|
|
813
|
+
return this.withRetry(async () => {
|
|
814
|
+
const response = await this.ensureAuth().apiCall('bookmarks.remove', {
|
|
815
|
+
channel_id: channel,
|
|
816
|
+
bookmark_id: bookmarkId,
|
|
817
|
+
});
|
|
818
|
+
this.checkResponse(response);
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
async listBookmarks(channel) {
|
|
822
|
+
return this.withRetry(async () => {
|
|
823
|
+
const response = await this.ensureAuth().apiCall('bookmarks.list', { channel_id: channel });
|
|
824
|
+
this.checkResponse(response);
|
|
825
|
+
return (response.bookmarks || []).map((b) => ({
|
|
826
|
+
id: b.id || '',
|
|
827
|
+
channel_id: b.channel_id || channel,
|
|
828
|
+
title: b.title || '',
|
|
829
|
+
link: b.link || '',
|
|
830
|
+
emoji: b.emoji,
|
|
831
|
+
icon_url: b.icon_url,
|
|
832
|
+
type: b.type || 'link',
|
|
833
|
+
date_created: b.date_created || 0,
|
|
834
|
+
date_updated: b.date_updated || 0,
|
|
835
|
+
created_by: b.created_by || '',
|
|
836
|
+
}));
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
async scheduleMessage(channel, text, postAt, threadTs) {
|
|
840
|
+
return this.withRetry(async () => {
|
|
841
|
+
const response = await this.ensureAuth().chat.scheduleMessage({
|
|
842
|
+
channel,
|
|
843
|
+
text,
|
|
844
|
+
post_at: postAt,
|
|
845
|
+
thread_ts: threadTs,
|
|
846
|
+
});
|
|
847
|
+
this.checkResponse(response);
|
|
848
|
+
return {
|
|
849
|
+
id: response.scheduled_message_id || '',
|
|
850
|
+
channel_id: channel,
|
|
851
|
+
post_at: postAt,
|
|
852
|
+
date_created: Math.floor(Date.now() / 1000),
|
|
853
|
+
text,
|
|
854
|
+
};
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
async listScheduledMessages(channel) {
|
|
858
|
+
return this.withRetry(async () => {
|
|
859
|
+
const allMessages = [];
|
|
860
|
+
let cursor;
|
|
861
|
+
do {
|
|
862
|
+
const response = await this.ensureAuth().chat.scheduledMessages.list({
|
|
863
|
+
...(channel ? { channel } : {}),
|
|
864
|
+
...(cursor ? { cursor } : {}),
|
|
865
|
+
});
|
|
866
|
+
this.checkResponse(response);
|
|
867
|
+
const messages = (response.scheduled_messages || []).map((msg) => ({
|
|
868
|
+
id: msg.id || msg.scheduled_message_id || '',
|
|
869
|
+
channel_id: msg.channel_id || '',
|
|
870
|
+
post_at: msg.post_at || 0,
|
|
871
|
+
date_created: msg.date_created || 0,
|
|
872
|
+
text: msg.text || '',
|
|
873
|
+
}));
|
|
874
|
+
allMessages.push(...messages);
|
|
875
|
+
cursor = response.response_metadata?.next_cursor;
|
|
876
|
+
} while (cursor);
|
|
877
|
+
return allMessages;
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
async deleteScheduledMessage(channel, scheduledMessageId) {
|
|
881
|
+
return this.withRetry(async () => {
|
|
882
|
+
const response = await this.ensureAuth().chat.deleteScheduledMessage({
|
|
883
|
+
channel,
|
|
884
|
+
scheduled_message_id: scheduledMessageId,
|
|
885
|
+
});
|
|
886
|
+
this.checkResponse(response);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
async createChannel(name, isPrivate) {
|
|
890
|
+
return this.withRetry(async () => {
|
|
891
|
+
const response = await this.ensureAuth().conversations.create({ name, is_private: isPrivate });
|
|
892
|
+
this.checkResponse(response);
|
|
893
|
+
const ch = response.channel;
|
|
894
|
+
return {
|
|
895
|
+
id: ch.id,
|
|
896
|
+
name: ch.name,
|
|
897
|
+
is_private: ch.is_private || false,
|
|
898
|
+
is_archived: ch.is_archived || false,
|
|
899
|
+
created: ch.created || 0,
|
|
900
|
+
creator: ch.creator || '',
|
|
901
|
+
topic: ch.topic
|
|
902
|
+
? {
|
|
903
|
+
value: ch.topic.value || '',
|
|
904
|
+
creator: ch.topic.creator || '',
|
|
905
|
+
last_set: ch.topic.last_set || 0,
|
|
906
|
+
}
|
|
907
|
+
: undefined,
|
|
908
|
+
purpose: ch.purpose
|
|
909
|
+
? {
|
|
910
|
+
value: ch.purpose.value || '',
|
|
911
|
+
creator: ch.purpose.creator || '',
|
|
912
|
+
last_set: ch.purpose.last_set || 0,
|
|
913
|
+
}
|
|
914
|
+
: undefined,
|
|
915
|
+
};
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
async archiveChannel(channel) {
|
|
919
|
+
return this.withRetry(async () => {
|
|
920
|
+
const response = await this.ensureAuth().conversations.archive({ channel });
|
|
921
|
+
this.checkResponse(response);
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
async setChannelTopic(channel, topic) {
|
|
925
|
+
return this.withRetry(async () => {
|
|
926
|
+
const response = await this.ensureAuth().conversations.setTopic({ channel, topic });
|
|
927
|
+
this.checkResponse(response);
|
|
928
|
+
return { topic: response.topic || topic };
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
async setChannelPurpose(channel, purpose) {
|
|
932
|
+
return this.withRetry(async () => {
|
|
933
|
+
const response = await this.ensureAuth().conversations.setPurpose({ channel, purpose });
|
|
934
|
+
this.checkResponse(response);
|
|
935
|
+
return { purpose: response.purpose || purpose };
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
async inviteToChannel(channel, users) {
|
|
939
|
+
return this.withRetry(async () => {
|
|
940
|
+
const response = await this.ensureAuth().conversations.invite({ channel, users });
|
|
941
|
+
this.checkResponse(response);
|
|
942
|
+
const ch = response.channel;
|
|
943
|
+
return {
|
|
944
|
+
id: ch.id,
|
|
945
|
+
name: ch.name,
|
|
946
|
+
is_private: ch.is_private || false,
|
|
947
|
+
is_archived: ch.is_archived || false,
|
|
948
|
+
created: ch.created || 0,
|
|
949
|
+
creator: ch.creator || '',
|
|
950
|
+
};
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
async joinChannel(channel) {
|
|
954
|
+
return this.withRetry(async () => {
|
|
955
|
+
const response = await this.ensureAuth().conversations.join({ channel });
|
|
956
|
+
this.checkResponse(response);
|
|
957
|
+
const ch = response.channel;
|
|
958
|
+
return {
|
|
959
|
+
id: ch.id,
|
|
960
|
+
name: ch.name,
|
|
961
|
+
is_private: ch.is_private || false,
|
|
962
|
+
is_archived: ch.is_archived || false,
|
|
963
|
+
created: ch.created || 0,
|
|
964
|
+
creator: ch.creator || '',
|
|
965
|
+
};
|
|
966
|
+
});
|
|
967
|
+
}
|
|
968
|
+
async leaveChannel(channel) {
|
|
969
|
+
return this.withRetry(async () => {
|
|
970
|
+
const response = await this.ensureAuth().conversations.leave({ channel });
|
|
971
|
+
this.checkResponse(response);
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
async lookupUserByEmail(email) {
|
|
975
|
+
return this.withRetry(async () => {
|
|
976
|
+
const response = await this.ensureAuth().users.lookupByEmail({ email });
|
|
977
|
+
this.checkResponse(response);
|
|
978
|
+
const member = response.user;
|
|
979
|
+
return {
|
|
980
|
+
id: member.id,
|
|
981
|
+
name: member.name,
|
|
982
|
+
real_name: member.real_name || member.name || '',
|
|
983
|
+
is_admin: member.is_admin || false,
|
|
984
|
+
is_owner: member.is_owner || false,
|
|
985
|
+
is_bot: member.is_bot || false,
|
|
986
|
+
is_app_user: member.is_app_user || false,
|
|
987
|
+
profile: member.profile
|
|
988
|
+
? {
|
|
989
|
+
email: member.profile.email,
|
|
990
|
+
phone: member.profile.phone,
|
|
991
|
+
title: member.profile.title,
|
|
992
|
+
status_text: member.profile.status_text,
|
|
993
|
+
}
|
|
994
|
+
: undefined,
|
|
995
|
+
};
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
async getUserProfile(userId) {
|
|
999
|
+
return this.withRetry(async () => {
|
|
1000
|
+
const response = await this.ensureAuth().users.profile.get({ user: userId });
|
|
1001
|
+
this.checkResponse(response);
|
|
1002
|
+
const p = response.profile || {};
|
|
1003
|
+
return {
|
|
1004
|
+
title: p.title,
|
|
1005
|
+
phone: p.phone,
|
|
1006
|
+
skype: p.skype,
|
|
1007
|
+
real_name: p.real_name,
|
|
1008
|
+
real_name_normalized: p.real_name_normalized,
|
|
1009
|
+
display_name: p.display_name,
|
|
1010
|
+
display_name_normalized: p.display_name_normalized,
|
|
1011
|
+
status_text: p.status_text,
|
|
1012
|
+
status_emoji: p.status_emoji,
|
|
1013
|
+
status_expiration: p.status_expiration,
|
|
1014
|
+
email: p.email,
|
|
1015
|
+
first_name: p.first_name,
|
|
1016
|
+
last_name: p.last_name,
|
|
1017
|
+
image_24: p.image_24,
|
|
1018
|
+
image_32: p.image_32,
|
|
1019
|
+
image_48: p.image_48,
|
|
1020
|
+
image_72: p.image_72,
|
|
1021
|
+
image_192: p.image_192,
|
|
1022
|
+
image_512: p.image_512,
|
|
1023
|
+
};
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
async setUserProfile(profile) {
|
|
1027
|
+
return this.withRetry(async () => {
|
|
1028
|
+
const response = await this.ensureAuth().users.profile.set({ profile: profile });
|
|
1029
|
+
this.checkResponse(response);
|
|
1030
|
+
const p = response.profile || {};
|
|
1031
|
+
return {
|
|
1032
|
+
title: p.title,
|
|
1033
|
+
phone: p.phone,
|
|
1034
|
+
skype: p.skype,
|
|
1035
|
+
real_name: p.real_name,
|
|
1036
|
+
real_name_normalized: p.real_name_normalized,
|
|
1037
|
+
display_name: p.display_name,
|
|
1038
|
+
display_name_normalized: p.display_name_normalized,
|
|
1039
|
+
status_text: p.status_text,
|
|
1040
|
+
status_emoji: p.status_emoji,
|
|
1041
|
+
status_expiration: p.status_expiration,
|
|
1042
|
+
email: p.email,
|
|
1043
|
+
first_name: p.first_name,
|
|
1044
|
+
last_name: p.last_name,
|
|
1045
|
+
image_24: p.image_24,
|
|
1046
|
+
image_32: p.image_32,
|
|
1047
|
+
image_48: p.image_48,
|
|
1048
|
+
image_72: p.image_72,
|
|
1049
|
+
image_192: p.image_192,
|
|
1050
|
+
image_512: p.image_512,
|
|
1051
|
+
};
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
async postEphemeral(channel, user, text) {
|
|
1055
|
+
return this.withRetry(async () => {
|
|
1056
|
+
const response = await this.ensureAuth().chat.postEphemeral({ channel, user, text });
|
|
1057
|
+
this.checkResponse(response);
|
|
1058
|
+
return response.message_ts || '';
|
|
1059
|
+
});
|
|
1060
|
+
}
|
|
1061
|
+
async getPermalink(channel, ts) {
|
|
1062
|
+
return this.withRetry(async () => {
|
|
1063
|
+
const response = await this.ensureAuth().chat.getPermalink({ channel, message_ts: ts });
|
|
1064
|
+
this.checkResponse(response);
|
|
1065
|
+
return response.permalink || '';
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
async addReminder(text, time, options) {
|
|
1069
|
+
return this.withRetry(async () => {
|
|
1070
|
+
const response = await this.ensureAuth().reminders.add({ text, time: time, user: options?.user });
|
|
1071
|
+
this.checkResponse(response);
|
|
1072
|
+
const r = response.reminder || {};
|
|
1073
|
+
return {
|
|
1074
|
+
id: r.id || '',
|
|
1075
|
+
creator: r.creator || '',
|
|
1076
|
+
text: r.text || text,
|
|
1077
|
+
user: r.user || '',
|
|
1078
|
+
recurring: r.recurring || false,
|
|
1079
|
+
time: r.time || time,
|
|
1080
|
+
complete_ts: r.complete_ts || 0,
|
|
1081
|
+
};
|
|
1082
|
+
});
|
|
1083
|
+
}
|
|
1084
|
+
async listReminders() {
|
|
1085
|
+
return this.withRetry(async () => {
|
|
1086
|
+
const response = await this.ensureAuth().reminders.list({});
|
|
1087
|
+
this.checkResponse(response);
|
|
1088
|
+
return (response.reminders || []).map((r) => ({
|
|
1089
|
+
id: r.id || '',
|
|
1090
|
+
creator: r.creator || '',
|
|
1091
|
+
text: r.text || '',
|
|
1092
|
+
user: r.user || '',
|
|
1093
|
+
recurring: r.recurring || false,
|
|
1094
|
+
time: r.time || 0,
|
|
1095
|
+
complete_ts: r.complete_ts || 0,
|
|
1096
|
+
}));
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
async completeReminder(reminderId) {
|
|
1100
|
+
return this.withRetry(async () => {
|
|
1101
|
+
const response = await this.ensureAuth().reminders.complete({ reminder: reminderId });
|
|
1102
|
+
this.checkResponse(response);
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
async deleteReminder(reminderId) {
|
|
1106
|
+
return this.withRetry(async () => {
|
|
1107
|
+
const response = await this.ensureAuth().reminders.delete({ reminder: reminderId });
|
|
1108
|
+
this.checkResponse(response);
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
async deleteFile(fileId) {
|
|
1112
|
+
return this.withRetry(async () => {
|
|
1113
|
+
const response = await this.ensureAuth().files.delete({ file: fileId });
|
|
1114
|
+
this.checkResponse(response);
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
async listEmoji() {
|
|
1118
|
+
return this.withRetry(async () => {
|
|
1119
|
+
const response = await this.ensureAuth().emoji.list({});
|
|
1120
|
+
this.checkResponse(response);
|
|
1121
|
+
return (response.emoji || {});
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
mapUsergroup(ug) {
|
|
1125
|
+
return {
|
|
1126
|
+
id: ug.id || '',
|
|
1127
|
+
team_id: ug.team_id || '',
|
|
1128
|
+
name: ug.name || '',
|
|
1129
|
+
handle: ug.handle || '',
|
|
1130
|
+
description: ug.description || '',
|
|
1131
|
+
is_external: ug.is_external ?? false,
|
|
1132
|
+
is_usergroup: ug.is_usergroup ?? true,
|
|
1133
|
+
date_create: ug.date_create ?? 0,
|
|
1134
|
+
date_update: ug.date_update ?? 0,
|
|
1135
|
+
date_delete: ug.date_delete ?? 0,
|
|
1136
|
+
auto_type: ug.auto_type ?? null,
|
|
1137
|
+
created_by: ug.created_by || '',
|
|
1138
|
+
updated_by: ug.updated_by || '',
|
|
1139
|
+
deleted_by: ug.deleted_by ?? null,
|
|
1140
|
+
prefs: {
|
|
1141
|
+
channels: ug.prefs?.channels || [],
|
|
1142
|
+
groups: ug.prefs?.groups || [],
|
|
1143
|
+
},
|
|
1144
|
+
users: ug.users || [],
|
|
1145
|
+
user_count: ug.user_count ?? 0,
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
async listUsergroups(options) {
|
|
1149
|
+
return this.withRetry(async () => {
|
|
1150
|
+
const response = await this.ensureAuth().apiCall('usergroups.list', {
|
|
1151
|
+
include_disabled: options?.includeDisabled,
|
|
1152
|
+
include_users: options?.includeUsers,
|
|
1153
|
+
include_count: options?.includeCount,
|
|
1154
|
+
});
|
|
1155
|
+
this.checkResponse(response);
|
|
1156
|
+
return (response.usergroups || []).map((ug) => this.mapUsergroup(ug));
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
async createUsergroup(name, options) {
|
|
1160
|
+
return this.withRetry(async () => {
|
|
1161
|
+
const response = await this.ensureAuth().apiCall('usergroups.create', {
|
|
1162
|
+
name,
|
|
1163
|
+
handle: options?.handle,
|
|
1164
|
+
description: options?.description,
|
|
1165
|
+
channels: options?.channels?.join(','),
|
|
1166
|
+
});
|
|
1167
|
+
this.checkResponse(response);
|
|
1168
|
+
return this.mapUsergroup(response.usergroup);
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
async updateUsergroup(usergroupId, options) {
|
|
1172
|
+
return this.withRetry(async () => {
|
|
1173
|
+
const response = await this.ensureAuth().apiCall('usergroups.update', {
|
|
1174
|
+
usergroup: usergroupId,
|
|
1175
|
+
name: options.name,
|
|
1176
|
+
handle: options.handle,
|
|
1177
|
+
description: options.description,
|
|
1178
|
+
channels: options.channels?.join(','),
|
|
1179
|
+
});
|
|
1180
|
+
this.checkResponse(response);
|
|
1181
|
+
return this.mapUsergroup(response.usergroup);
|
|
1182
|
+
});
|
|
1183
|
+
}
|
|
1184
|
+
async disableUsergroup(usergroupId) {
|
|
1185
|
+
return this.withRetry(async () => {
|
|
1186
|
+
const response = await this.ensureAuth().apiCall('usergroups.disable', {
|
|
1187
|
+
usergroup: usergroupId,
|
|
1188
|
+
});
|
|
1189
|
+
this.checkResponse(response);
|
|
1190
|
+
return this.mapUsergroup(response.usergroup);
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
async enableUsergroup(usergroupId) {
|
|
1194
|
+
return this.withRetry(async () => {
|
|
1195
|
+
const response = await this.ensureAuth().apiCall('usergroups.enable', {
|
|
1196
|
+
usergroup: usergroupId,
|
|
1197
|
+
});
|
|
1198
|
+
this.checkResponse(response);
|
|
1199
|
+
return this.mapUsergroup(response.usergroup);
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
async listUsergroupMembers(usergroupId, options) {
|
|
1203
|
+
return this.withRetry(async () => {
|
|
1204
|
+
const response = await this.ensureAuth().apiCall('usergroups.users.list', {
|
|
1205
|
+
usergroup: usergroupId,
|
|
1206
|
+
include_disabled: options?.includeDisabled,
|
|
1207
|
+
});
|
|
1208
|
+
this.checkResponse(response);
|
|
1209
|
+
return response.users || [];
|
|
1210
|
+
});
|
|
1211
|
+
}
|
|
1212
|
+
async updateUsergroupMembers(usergroupId, users) {
|
|
1213
|
+
return this.withRetry(async () => {
|
|
1214
|
+
const response = await this.ensureAuth().apiCall('usergroups.users.update', {
|
|
1215
|
+
usergroup: usergroupId,
|
|
1216
|
+
users: users.join(','),
|
|
1217
|
+
});
|
|
1218
|
+
this.checkResponse(response);
|
|
1219
|
+
return this.mapUsergroup(response.usergroup);
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
685
1222
|
}
|
|
686
1223
|
//# sourceMappingURL=client.js.map
|