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
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { Writable } from 'node:stream';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { handleError } from '../../../shared/utils/error-handler.js';
|
|
4
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
5
|
+
import { InstagramClient } from '../client.js';
|
|
6
|
+
import { InstagramCredentialManager } from '../credential-manager.js';
|
|
7
|
+
import { createAccountId } from '../types.js';
|
|
8
|
+
function isInteractive() {
|
|
9
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
10
|
+
}
|
|
11
|
+
async function promptText(message) {
|
|
12
|
+
const { createInterface } = await import('node:readline/promises');
|
|
13
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: true });
|
|
14
|
+
try {
|
|
15
|
+
const answer = await rl.question(`${message}: `);
|
|
16
|
+
return answer.trim() || undefined;
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
rl.close();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function promptHidden(message) {
|
|
23
|
+
const { createInterface } = await import('node:readline/promises');
|
|
24
|
+
const hiddenOutput = new (class extends Writable {
|
|
25
|
+
muted = false;
|
|
26
|
+
_write(chunk, encoding, cb) {
|
|
27
|
+
if (!this.muted)
|
|
28
|
+
process.stdout.write(chunk, encoding);
|
|
29
|
+
cb();
|
|
30
|
+
}
|
|
31
|
+
})();
|
|
32
|
+
const rl = createInterface({ input: process.stdin, output: hiddenOutput, terminal: true });
|
|
33
|
+
try {
|
|
34
|
+
hiddenOutput.muted = true;
|
|
35
|
+
process.stdout.write(`${message}: `);
|
|
36
|
+
const answer = await rl.question('');
|
|
37
|
+
process.stdout.write('\n');
|
|
38
|
+
return answer.trim() || undefined;
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
hiddenOutput.muted = false;
|
|
42
|
+
rl.close();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function saveAccountAndPrint(manager, accountId, username, userId, pretty) {
|
|
46
|
+
const now = new Date().toISOString();
|
|
47
|
+
await manager.setAccount({
|
|
48
|
+
account_id: accountId,
|
|
49
|
+
username,
|
|
50
|
+
pk: userId,
|
|
51
|
+
created_at: now,
|
|
52
|
+
updated_at: now,
|
|
53
|
+
});
|
|
54
|
+
await manager.setCurrent(accountId);
|
|
55
|
+
console.log(formatOutput({
|
|
56
|
+
authenticated: true,
|
|
57
|
+
account_id: accountId,
|
|
58
|
+
username,
|
|
59
|
+
}, pretty));
|
|
60
|
+
}
|
|
61
|
+
async function loginAction(options) {
|
|
62
|
+
try {
|
|
63
|
+
const interactive = isInteractive();
|
|
64
|
+
let { username, password } = options;
|
|
65
|
+
if (!username) {
|
|
66
|
+
if (!interactive) {
|
|
67
|
+
console.log(formatOutput({
|
|
68
|
+
error: 'Username required. Use --username <username> --password <password>.',
|
|
69
|
+
}, options.pretty));
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
username = await promptText('Instagram username');
|
|
73
|
+
if (!username) {
|
|
74
|
+
console.error('Username is required.');
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!password) {
|
|
79
|
+
if (!interactive) {
|
|
80
|
+
console.log(formatOutput({
|
|
81
|
+
error: 'Password required. Use --username <username> --password <password>.',
|
|
82
|
+
}, options.pretty));
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
password = await promptHidden('Password');
|
|
86
|
+
if (!password) {
|
|
87
|
+
console.error('Password is required.');
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const manager = new InstagramCredentialManager();
|
|
92
|
+
const accountId = createAccountId(username);
|
|
93
|
+
const paths = await manager.ensureAccountPaths(accountId);
|
|
94
|
+
const client = new InstagramClient(manager);
|
|
95
|
+
client.setSessionPath(paths.session_path);
|
|
96
|
+
if (options.debug) {
|
|
97
|
+
client.setDebugLog((msg) => console.error(`[debug] ${msg}`));
|
|
98
|
+
}
|
|
99
|
+
const result = await client.authenticate(username, password);
|
|
100
|
+
if (result.requiresTwoFactor) {
|
|
101
|
+
const twoFactorIdentifier = result.twoFactorInfo?.['two_factor_identifier'] ?? '';
|
|
102
|
+
if (interactive) {
|
|
103
|
+
console.error('\n Two-factor authentication required.');
|
|
104
|
+
const code = await promptText('Verification code');
|
|
105
|
+
if (!code) {
|
|
106
|
+
console.error('Code is required.');
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
const tfResult = await client.twoFactorLogin(username, code, twoFactorIdentifier);
|
|
110
|
+
await saveAccountAndPrint(manager, accountId, username, tfResult.userId, options.pretty);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
console.log(formatOutput({
|
|
114
|
+
two_factor_required: true,
|
|
115
|
+
two_factor_identifier: twoFactorIdentifier,
|
|
116
|
+
message: 'Run "agent-instagram auth verify --username <username> --code <code> --identifier <identifier>"',
|
|
117
|
+
}, options.pretty));
|
|
118
|
+
}
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (result.challengeRequired) {
|
|
122
|
+
if (interactive) {
|
|
123
|
+
await handleInteractiveChallenge(client, manager, accountId, username, result.challengePath, options.pretty);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
console.log(formatOutput({
|
|
127
|
+
challenge_required: true,
|
|
128
|
+
challenge_path: result.challengePath,
|
|
129
|
+
message: 'Run "agent-instagram auth challenge --username <username> --method email" then "agent-instagram auth challenge --username <username> --code <code>"',
|
|
130
|
+
}, options.pretty));
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
await saveAccountAndPrint(manager, accountId, username, result.userId, options.pretty);
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
handleError(error);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async function handleInteractiveChallenge(client, manager, accountId, username, challengePath, pretty) {
|
|
141
|
+
console.error('\n Security challenge required by Instagram.');
|
|
142
|
+
console.error(' Choose verification method:');
|
|
143
|
+
console.error(' 1. Email');
|
|
144
|
+
console.error(' 2. SMS');
|
|
145
|
+
console.error('');
|
|
146
|
+
const choice = await promptText('Method (1/2)');
|
|
147
|
+
const method = choice === '2' ? 'sms' : 'email';
|
|
148
|
+
const sendResult = await client.challengeSendCode(challengePath, method);
|
|
149
|
+
if (sendResult.contactPoint) {
|
|
150
|
+
console.error(`\n Code sent to: ${sendResult.contactPoint}`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
console.error('\n Verification code sent.');
|
|
154
|
+
}
|
|
155
|
+
const code = await promptText('Verification code');
|
|
156
|
+
if (!code) {
|
|
157
|
+
console.error('Code is required.');
|
|
158
|
+
process.exit(1);
|
|
159
|
+
}
|
|
160
|
+
const verifyResult = await client.challengeSubmitCode(challengePath, code);
|
|
161
|
+
await saveAccountAndPrint(manager, accountId, username, verifyResult.userId, pretty);
|
|
162
|
+
}
|
|
163
|
+
async function verifyAction(options) {
|
|
164
|
+
try {
|
|
165
|
+
const manager = new InstagramCredentialManager();
|
|
166
|
+
const accountId = createAccountId(options.username);
|
|
167
|
+
const paths = await manager.ensureAccountPaths(accountId);
|
|
168
|
+
const client = new InstagramClient(manager);
|
|
169
|
+
client.setSessionPath(paths.session_path);
|
|
170
|
+
const result = await client.twoFactorLogin(options.username, options.code, options.identifier);
|
|
171
|
+
await saveAccountAndPrint(manager, accountId, options.username, result.userId, options.pretty);
|
|
172
|
+
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
handleError(error);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function challengeAction(options) {
|
|
178
|
+
try {
|
|
179
|
+
const manager = new InstagramCredentialManager();
|
|
180
|
+
const accountId = createAccountId(options.username);
|
|
181
|
+
const paths = await manager.ensureAccountPaths(accountId);
|
|
182
|
+
const client = new InstagramClient(manager);
|
|
183
|
+
client.setSessionPath(paths.session_path);
|
|
184
|
+
await client.loadSession(paths.session_path);
|
|
185
|
+
const challengePath = client.getChallengePath();
|
|
186
|
+
if (!challengePath) {
|
|
187
|
+
console.log(formatOutput({
|
|
188
|
+
error: 'No pending challenge found. Run "agent-instagram auth login" first.',
|
|
189
|
+
}, options.pretty));
|
|
190
|
+
process.exit(1);
|
|
191
|
+
}
|
|
192
|
+
if (options.code) {
|
|
193
|
+
const result = await client.challengeSubmitCode(challengePath, options.code);
|
|
194
|
+
await saveAccountAndPrint(manager, accountId, options.username, result.userId, options.pretty);
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
const method = (options.method === 'sms' ? 'sms' : 'email');
|
|
198
|
+
const result = await client.challengeSendCode(challengePath, method);
|
|
199
|
+
console.log(formatOutput({
|
|
200
|
+
code_sent: true,
|
|
201
|
+
contact_point: result.contactPoint,
|
|
202
|
+
step_name: result.stepName,
|
|
203
|
+
message: `Verification code sent. Run "agent-instagram auth challenge --username ${options.username} --code <code>" to complete.`,
|
|
204
|
+
}, options.pretty));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
handleError(error);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
async function statusAction(options) {
|
|
212
|
+
try {
|
|
213
|
+
const manager = new InstagramCredentialManager();
|
|
214
|
+
const account = await manager.getAccount(options.account);
|
|
215
|
+
if (!account) {
|
|
216
|
+
console.log(formatOutput({
|
|
217
|
+
error: options.account
|
|
218
|
+
? `Instagram account "${options.account}" not found.`
|
|
219
|
+
: 'No Instagram account configured. Run "auth login" first.',
|
|
220
|
+
}, options.pretty));
|
|
221
|
+
process.exit(1);
|
|
222
|
+
}
|
|
223
|
+
console.log(formatOutput({
|
|
224
|
+
account_id: account.account_id,
|
|
225
|
+
username: account.username,
|
|
226
|
+
full_name: account.full_name,
|
|
227
|
+
pk: account.pk,
|
|
228
|
+
created_at: account.created_at,
|
|
229
|
+
updated_at: account.updated_at,
|
|
230
|
+
}, options.pretty));
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
handleError(error);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
async function listAction(options) {
|
|
237
|
+
try {
|
|
238
|
+
const manager = new InstagramCredentialManager();
|
|
239
|
+
const accounts = await manager.listAccounts();
|
|
240
|
+
console.log(formatOutput(accounts.map((account) => ({
|
|
241
|
+
account_id: account.account_id,
|
|
242
|
+
username: account.username,
|
|
243
|
+
full_name: account.full_name,
|
|
244
|
+
pk: account.pk,
|
|
245
|
+
created_at: account.created_at,
|
|
246
|
+
updated_at: account.updated_at,
|
|
247
|
+
is_current: account.is_current,
|
|
248
|
+
})), options.pretty));
|
|
249
|
+
}
|
|
250
|
+
catch (error) {
|
|
251
|
+
handleError(error);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async function useAction(accountId, options) {
|
|
255
|
+
try {
|
|
256
|
+
const manager = new InstagramCredentialManager();
|
|
257
|
+
const found = await manager.setCurrent(accountId);
|
|
258
|
+
if (!found) {
|
|
259
|
+
console.log(formatOutput({ error: `Instagram account "${accountId}" not found.` }, options.pretty));
|
|
260
|
+
process.exit(1);
|
|
261
|
+
}
|
|
262
|
+
const current = await manager.getAccount();
|
|
263
|
+
console.log(formatOutput({ success: true, account_id: current?.account_id }, options.pretty));
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
handleError(error);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
async function logoutAction(options) {
|
|
270
|
+
try {
|
|
271
|
+
const manager = new InstagramCredentialManager();
|
|
272
|
+
const account = await manager.getAccount(options.account);
|
|
273
|
+
if (!account) {
|
|
274
|
+
console.log(formatOutput({
|
|
275
|
+
error: options.account
|
|
276
|
+
? `Instagram account "${options.account}" not found.`
|
|
277
|
+
: 'No Instagram account configured.',
|
|
278
|
+
}, options.pretty));
|
|
279
|
+
process.exit(1);
|
|
280
|
+
}
|
|
281
|
+
await manager.removeAccount(account.account_id);
|
|
282
|
+
console.log(formatOutput({ success: true, account_id: account.account_id, logged_out: true }, options.pretty));
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
handleError(error);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
export const authCommand = new Command('auth')
|
|
289
|
+
.description('Instagram authentication commands')
|
|
290
|
+
.addCommand(new Command('login')
|
|
291
|
+
.description('Log in to Instagram; prompts interactively or accepts flags for AI agents')
|
|
292
|
+
.option('--username <username>', 'Instagram username')
|
|
293
|
+
.option('--password <password>', 'Instagram password')
|
|
294
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
295
|
+
.option('--debug', 'Show raw API responses')
|
|
296
|
+
.action(loginAction))
|
|
297
|
+
.addCommand(new Command('verify')
|
|
298
|
+
.description('Complete two-factor authentication (non-interactive)')
|
|
299
|
+
.requiredOption('--username <username>', 'Instagram username')
|
|
300
|
+
.requiredOption('--code <code>', 'Two-factor verification code')
|
|
301
|
+
.requiredOption('--identifier <identifier>', 'Two-factor identifier from login response')
|
|
302
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
303
|
+
.action(verifyAction))
|
|
304
|
+
.addCommand(new Command('challenge')
|
|
305
|
+
.description('Resolve a security challenge (non-interactive)')
|
|
306
|
+
.requiredOption('--username <username>', 'Instagram username')
|
|
307
|
+
.option('--method <method>', 'Verification method: email or sms', 'email')
|
|
308
|
+
.option('--code <code>', 'Verification code received via email/sms')
|
|
309
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
310
|
+
.action(challengeAction))
|
|
311
|
+
.addCommand(new Command('status')
|
|
312
|
+
.description('Show authentication status')
|
|
313
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
314
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
315
|
+
.action(statusAction))
|
|
316
|
+
.addCommand(new Command('list')
|
|
317
|
+
.description('List stored Instagram accounts')
|
|
318
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
319
|
+
.action(listAction))
|
|
320
|
+
.addCommand(new Command('use')
|
|
321
|
+
.description('Switch the current Instagram account')
|
|
322
|
+
.argument('<account>', 'Account identifier')
|
|
323
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
324
|
+
.action(useAction))
|
|
325
|
+
.addCommand(new Command('logout')
|
|
326
|
+
.description('Remove stored credentials and session')
|
|
327
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
328
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
329
|
+
.action(logoutAction));
|
|
330
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EA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T,IAAI,OAAO,CAAC,MAAM,CAAC;KAChB,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,KAAK,CAAC;KACf,WAAW,CAAC,sCAAsC,CAAC;KACnD,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;KAC3C,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,SAAS,CAAC,CACrB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,uCAAuC,CAAC;KACpD,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;KAC5D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA8BnC,eAAO,MAAM,WAAW,SAkBrB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { handleError } from '../../../shared/utils/error-handler.js';
|
|
3
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
4
|
+
import { parseLimitOption, withInstagramClient } from './shared.js';
|
|
5
|
+
async function listAction(options) {
|
|
6
|
+
try {
|
|
7
|
+
const limit = parseLimitOption(options.limit, 20);
|
|
8
|
+
const chats = await withInstagramClient(options, (client) => client.listChats(limit));
|
|
9
|
+
console.log(formatOutput(chats, options.pretty));
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
handleError(error);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function searchAction(query, options) {
|
|
17
|
+
try {
|
|
18
|
+
const limit = parseLimitOption(options.limit, 20);
|
|
19
|
+
const chats = await withInstagramClient(options, (client) => client.searchChats(query, limit));
|
|
20
|
+
console.log(formatOutput(chats, options.pretty));
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
handleError(error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export const chatCommand = new Command('chat')
|
|
28
|
+
.description('Instagram chat commands')
|
|
29
|
+
.addCommand(new Command('list')
|
|
30
|
+
.description('List DM conversations')
|
|
31
|
+
.option('--limit <n>', 'Number of chats to fetch', '20')
|
|
32
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
33
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
34
|
+
.action(listAction))
|
|
35
|
+
.addCommand(new Command('search')
|
|
36
|
+
.description('Search DM conversations by name')
|
|
37
|
+
.argument('<query>', 'Search query')
|
|
38
|
+
.option('--limit <n>', 'Number of results to return', '20')
|
|
39
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
40
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
41
|
+
.action(searchAction));
|
|
42
|
+
//# sourceMappingURL=chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEhE,KAAK,UAAU,UAAU,CAAC,OAA+D;IACvF,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,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0BAA0B,CAAC;KAC9C,MAAM,CAAC,UAAU,CAAC,CACtB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;KACnC,MAAM,CAAC,aAAa,EAAE,6BAA6B,EAAE,IAAI,CAAC;KAC1D,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;KAC5D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAuFnC,eAAO,MAAM,cAAc,SA8CxB,CAAA"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { handleError } from '../../../shared/utils/error-handler.js';
|
|
3
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
4
|
+
import { parseLimitOption, withInstagramClient } from './shared.js';
|
|
5
|
+
async function listAction(threadId, options) {
|
|
6
|
+
try {
|
|
7
|
+
const limit = parseLimitOption(options.limit, 25);
|
|
8
|
+
const messages = await withInstagramClient(options, (client) => client.getMessages(threadId, limit));
|
|
9
|
+
console.log(formatOutput(messages, options.pretty));
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
handleError(error);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function sendAction(threadId, text, options) {
|
|
17
|
+
try {
|
|
18
|
+
const message = await withInstagramClient(options, (client) => client.sendMessage(threadId, text));
|
|
19
|
+
console.log(formatOutput(message, options.pretty));
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
handleError(error);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function sendToAction(username, text, options) {
|
|
27
|
+
try {
|
|
28
|
+
const message = await withInstagramClient(options, async (client) => {
|
|
29
|
+
const cleaned = username.replace(/^@/, '');
|
|
30
|
+
const users = await client.searchUsers(cleaned);
|
|
31
|
+
const exactMatch = users.find((u) => u.username.toLowerCase() === cleaned.toLowerCase());
|
|
32
|
+
if (!exactMatch) {
|
|
33
|
+
throw new (await import('../types.js')).InstagramError(`User "${cleaned}" not found. Search returned: ${users.map((u) => u.username).join(', ') || 'no results'}`, 'user_not_found');
|
|
34
|
+
}
|
|
35
|
+
return client.sendMessageToUser(exactMatch.pk, text);
|
|
36
|
+
});
|
|
37
|
+
console.log(formatOutput(message, options.pretty));
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
handleError(error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
async function searchAction(query, options) {
|
|
45
|
+
try {
|
|
46
|
+
const limit = parseLimitOption(options.limit, 20);
|
|
47
|
+
const messages = await withInstagramClient(options, (client) => client.searchMessages(query, { threadId: options.thread, limit }));
|
|
48
|
+
console.log(formatOutput(messages, options.pretty));
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
handleError(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function searchUsersAction(query, options) {
|
|
56
|
+
try {
|
|
57
|
+
const users = await withInstagramClient(options, (client) => client.searchUsers(query));
|
|
58
|
+
console.log(formatOutput(users, options.pretty));
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
handleError(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export const messageCommand = new Command('message')
|
|
66
|
+
.description('Instagram message commands')
|
|
67
|
+
.addCommand(new Command('list')
|
|
68
|
+
.description('List messages from a DM thread')
|
|
69
|
+
.argument('<thread-id>', 'Thread ID')
|
|
70
|
+
.option('--limit <n>', 'Number of messages to fetch', '25')
|
|
71
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
72
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
73
|
+
.action(listAction))
|
|
74
|
+
.addCommand(new Command('send')
|
|
75
|
+
.description('Send a text message to a DM thread')
|
|
76
|
+
.argument('<thread-id>', 'Thread ID')
|
|
77
|
+
.argument('<text>', 'Message text')
|
|
78
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
79
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
80
|
+
.action(sendAction))
|
|
81
|
+
.addCommand(new Command('send-to')
|
|
82
|
+
.description('Send a text message to a user by @username')
|
|
83
|
+
.argument('<username>', 'Instagram @username')
|
|
84
|
+
.argument('<text>', 'Message text')
|
|
85
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
86
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
87
|
+
.action(sendToAction))
|
|
88
|
+
.addCommand(new Command('search')
|
|
89
|
+
.description('Search messages by text content')
|
|
90
|
+
.argument('<query>', 'Text to search for')
|
|
91
|
+
.option('--thread <id>', 'Search within a specific thread')
|
|
92
|
+
.option('--limit <n>', 'Maximum results', '20')
|
|
93
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
94
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
95
|
+
.action(searchAction))
|
|
96
|
+
.addCommand(new Command('search-users')
|
|
97
|
+
.description('Search Instagram users by username')
|
|
98
|
+
.argument('<query>', 'Search query')
|
|
99
|
+
.option('--account <id>', 'Use a specific Instagram account')
|
|
100
|
+
.option('--pretty', 'Pretty print JSON output')
|
|
101
|
+
.action(searchUsersAction));
|
|
102
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEhE,KAAK,UAAU,UAAU,CACvB,QAAgB,EAChB,OAA+D;IAE/D,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QACjD,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;QACpG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;QACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,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CAAC;KAClB,WAAW,CAAC,iCAAiC,CAAC;KAC9C,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;KACzC,MAAM,CAAC,eAAe,EAAE,iCAAiC,CAAC;KAC1D,MAAM,CAAC,aAAa,EAAE,iBAAiB,EAAE,IAAI,CAAC;KAC9C,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;KAC5D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,cAAc,CAAC;KACxB,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC;KACnC,MAAM,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;KAC5D,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,iBAAiB,CAAC,CAC7B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InstagramClient } from '../client.js';
|
|
2
|
+
export interface AccountOption {
|
|
3
|
+
account?: string;
|
|
4
|
+
pretty?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function parseLimitOption(rawLimit: string | undefined, defaultValue: number, maxValue?: number): number;
|
|
7
|
+
export declare function withInstagramClient<T>(options: AccountOption, fn: (client: InstagramClient) => Promise<T>): Promise<T>;
|
|
8
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAI3C,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,YAAY,EAAE,MAAM,EACpB,QAAQ,SAAM,GACb,MAAM,CAcR;AAED,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,OAAO,EAAE,aAAa,EACtB,EAAE,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,CAAC,CAAC,GAC1C,OAAO,CAAC,CAAC,CAAC,CAqBZ"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { formatOutput } from '../../../shared/utils/output.js';
|
|
2
|
+
import { InstagramClient } from '../client.js';
|
|
3
|
+
import { InstagramCredentialManager } from '../credential-manager.js';
|
|
4
|
+
import { InstagramError } from '../types.js';
|
|
5
|
+
export function parseLimitOption(rawLimit, defaultValue, maxValue = 100) {
|
|
6
|
+
const trimmed = (rawLimit ?? `${defaultValue}`).trim();
|
|
7
|
+
if (!/^\d+$/.test(trimmed)) {
|
|
8
|
+
throw new InstagramError(`--limit must be an integer between 1 and ${maxValue}.`, 'invalid_limit');
|
|
9
|
+
}
|
|
10
|
+
const parsed = Number.parseInt(trimmed, 10);
|
|
11
|
+
if (!Number.isInteger(parsed) || parsed <= 0 || parsed > maxValue) {
|
|
12
|
+
throw new InstagramError(`--limit must be an integer between 1 and ${maxValue}.`, 'invalid_limit');
|
|
13
|
+
}
|
|
14
|
+
return parsed;
|
|
15
|
+
}
|
|
16
|
+
export async function withInstagramClient(options, fn) {
|
|
17
|
+
const manager = new InstagramCredentialManager();
|
|
18
|
+
const account = await manager.getAccount(options.account);
|
|
19
|
+
if (!account) {
|
|
20
|
+
console.log(formatOutput({
|
|
21
|
+
error: options.account
|
|
22
|
+
? `Instagram account "${options.account}" not found. Run "agent-instagram auth login --username <username>" first.`
|
|
23
|
+
: 'Not authenticated. Run "agent-instagram auth login --username <username>" first.',
|
|
24
|
+
}, options.pretty));
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
const client = new InstagramClient(manager);
|
|
28
|
+
await client.login(undefined, account.account_id);
|
|
29
|
+
return fn(client);
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../src/platforms/instagram/commands/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAOzC,MAAM,UAAU,gBAAgB,CAC9B,QAA4B,EAC5B,YAAoB,EACpB,QAAQ,GAAG,GAAG;IAEd,MAAM,OAAO,GAAG,CAAC,QAAQ,IAAI,GAAG,YAAY,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;IAEtD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,cAAc,CAAC,4CAA4C,QAAQ,GAAG,EAAE,eAAe,CAAC,CAAA;IACpG,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;IAE3C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,QAAQ,EAAE,CAAC;QAClE,MAAM,IAAI,cAAc,CAAC,4CAA4C,QAAQ,GAAG,EAAE,eAAe,CAAC,CAAA;IACpG,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAsB,EACtB,EAA2C;IAE3C,MAAM,OAAO,GAAG,IAAI,0BAA0B,EAAE,CAAA;IAChD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAEzD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CACT,YAAY,CACV;YACE,KAAK,EAAE,OAAO,CAAC,OAAO;gBACpB,CAAC,CAAC,sBAAsB,OAAO,CAAC,OAAO,4EAA4E;gBACnH,CAAC,CAAC,kFAAkF;SACvF,EACD,OAAO,CAAC,MAAM,CACf,CACF,CAAA;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,CAAA;IAC3C,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IACjD,OAAO,EAAE,CAAC,MAAM,CAAC,CAAA;AACnB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type InstagramAccount, type InstagramAccountPaths, type InstagramConfig } from './types.js';
|
|
2
|
+
export declare class InstagramCredentialManager {
|
|
3
|
+
private configDir;
|
|
4
|
+
private credentialsPath;
|
|
5
|
+
private instagramRootDir;
|
|
6
|
+
constructor(configDir?: string);
|
|
7
|
+
loadConfig(): Promise<InstagramConfig>;
|
|
8
|
+
saveConfig(config: InstagramConfig): Promise<void>;
|
|
9
|
+
getAccount(accountId?: string): Promise<InstagramAccount | null>;
|
|
10
|
+
listAccounts(): Promise<Array<InstagramAccount & {
|
|
11
|
+
is_current: boolean;
|
|
12
|
+
}>>;
|
|
13
|
+
setAccount(account: InstagramAccount): Promise<void>;
|
|
14
|
+
setCurrent(accountId: string): Promise<boolean>;
|
|
15
|
+
removeAccount(accountId: string): Promise<boolean>;
|
|
16
|
+
clearCredentials(): Promise<void>;
|
|
17
|
+
getAccountPaths(accountId: string): InstagramAccountPaths;
|
|
18
|
+
ensureAccountPaths(accountId: string): Promise<InstagramAccountPaths>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=credential-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../../../src/platforms/instagram/credential-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,SAAS,CAAA;AAEhB,qBAAa,0BAA0B;IACrC,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,gBAAgB,CAAQ;gBAEpB,SAAS,CAAC,EAAE,MAAM;IAMxB,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC;IAatC,UAAU,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlD,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAgBhE,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,GAAG;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAS1E,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWpD,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAa/C,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBlD,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAUvC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,qBAAqB;IAUnD,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAK5E"}
|