agent-messenger 1.0.0 → 1.2.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/commands/release.md +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/e2e.yml.disabled +69 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +18 -15
- package/biome.json +34 -2
- package/bun.lock +63 -0
- package/dist/package.json +8 -4
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +4 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/platforms/discord/cli.js +4 -4
- package/dist/src/platforms/discord/cli.js.map +1 -1
- package/dist/src/platforms/discord/client.d.ts +26 -5
- package/dist/src/platforms/discord/client.d.ts.map +1 -1
- package/dist/src/platforms/discord/client.js +115 -17
- package/dist/src/platforms/discord/client.js.map +1 -1
- package/dist/src/platforms/discord/commands/auth.js +16 -16
- package/dist/src/platforms/discord/commands/auth.js.map +1 -1
- package/dist/src/platforms/discord/commands/channel.js +4 -4
- package/dist/src/platforms/discord/commands/channel.js.map +1 -1
- package/dist/src/platforms/discord/commands/dm.d.ts +9 -0
- package/dist/src/platforms/discord/commands/dm.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/dm.js +68 -0
- package/dist/src/platforms/discord/commands/dm.js.map +1 -0
- package/dist/src/platforms/discord/commands/friend.d.ts +3 -0
- package/dist/src/platforms/discord/commands/friend.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/friend.js +39 -0
- package/dist/src/platforms/discord/commands/friend.js.map +1 -0
- package/dist/src/platforms/discord/commands/index.d.ts +1 -1
- package/dist/src/platforms/discord/commands/index.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/index.js +1 -1
- package/dist/src/platforms/discord/commands/index.js.map +1 -1
- package/dist/src/platforms/discord/commands/member.d.ts +3 -0
- package/dist/src/platforms/discord/commands/member.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/member.js +47 -0
- package/dist/src/platforms/discord/commands/member.js.map +1 -0
- package/dist/src/platforms/discord/commands/mention.d.ts +8 -0
- package/dist/src/platforms/discord/commands/mention.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/mention.js +47 -0
- package/dist/src/platforms/discord/commands/mention.js.map +1 -0
- package/dist/src/platforms/discord/commands/message.d.ts +13 -0
- package/dist/src/platforms/discord/commands/message.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/message.js +95 -1
- package/dist/src/platforms/discord/commands/message.js.map +1 -1
- package/dist/src/platforms/discord/commands/note.d.ts +3 -0
- package/dist/src/platforms/discord/commands/note.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/note.js +56 -0
- package/dist/src/platforms/discord/commands/note.js.map +1 -0
- package/dist/src/platforms/discord/commands/profile.d.ts +3 -0
- package/dist/src/platforms/discord/commands/profile.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/profile.js +47 -0
- package/dist/src/platforms/discord/commands/profile.js.map +1 -0
- package/dist/src/platforms/discord/commands/server.d.ts +15 -0
- package/dist/src/platforms/discord/commands/server.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/server.js +102 -0
- package/dist/src/platforms/discord/commands/server.js.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.js +10 -10
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -1
- package/dist/src/platforms/discord/commands/thread.d.ts +10 -0
- package/dist/src/platforms/discord/commands/thread.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/thread.js +67 -0
- package/dist/src/platforms/discord/commands/thread.js.map +1 -0
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -1
- package/dist/src/platforms/discord/commands/user.js +14 -5
- package/dist/src/platforms/discord/commands/user.js.map +1 -1
- package/dist/src/platforms/discord/credential-manager.d.ts +13 -13
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/discord/credential-manager.js +28 -22
- package/dist/src/platforms/discord/credential-manager.js.map +1 -1
- package/dist/src/platforms/discord/super-properties.d.ts +4 -0
- package/dist/src/platforms/discord/super-properties.d.ts.map +1 -0
- package/dist/src/platforms/discord/super-properties.js +50 -0
- package/dist/src/platforms/discord/super-properties.js.map +1 -0
- package/dist/src/platforms/discord/token-extractor.d.ts +6 -1
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/discord/token-extractor.js +27 -2
- package/dist/src/platforms/discord/token-extractor.js.map +1 -1
- package/dist/src/platforms/discord/types.d.ts +389 -22
- package/dist/src/platforms/discord/types.d.ts.map +1 -1
- package/dist/src/platforms/discord/types.js +46 -4
- package/dist/src/platforms/discord/types.js.map +1 -1
- package/dist/src/platforms/slack/cli.d.ts.map +1 -1
- package/dist/src/platforms/slack/cli.js +7 -2
- package/dist/src/platforms/slack/cli.js.map +1 -1
- package/dist/src/platforms/slack/client.d.ts +19 -1
- package/dist/src/platforms/slack/client.d.ts.map +1 -1
- package/dist/src/platforms/slack/client.js +134 -0
- package/dist/src/platforms/slack/client.js.map +1 -1
- package/dist/src/platforms/slack/commands/activity.d.ts +3 -0
- package/dist/src/platforms/slack/commands/activity.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/activity.js +40 -0
- package/dist/src/platforms/slack/commands/activity.js.map +1 -0
- package/dist/src/platforms/slack/commands/drafts.d.ts +3 -0
- package/dist/src/platforms/slack/commands/drafts.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/drafts.js +45 -0
- package/dist/src/platforms/slack/commands/drafts.js.map +1 -0
- 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/saved.d.ts +3 -0
- package/dist/src/platforms/slack/commands/saved.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/saved.js +54 -0
- package/dist/src/platforms/slack/commands/saved.js.map +1 -0
- package/dist/src/platforms/slack/commands/sections.d.ts +3 -0
- package/dist/src/platforms/slack/commands/sections.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/sections.js +37 -0
- package/dist/src/platforms/slack/commands/sections.js.map +1 -0
- package/dist/src/platforms/slack/commands/unread.d.ts +12 -0
- package/dist/src/platforms/slack/commands/unread.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/unread.js +89 -0
- package/dist/src/platforms/slack/commands/unread.js.map +1 -0
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -1
- package/dist/src/platforms/slack/credential-manager.js +20 -6
- package/dist/src/platforms/slack/credential-manager.js.map +1 -1
- package/dist/src/platforms/slack/token-extractor.d.ts +8 -1
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -1
- package/dist/src/platforms/slack/token-extractor.js +83 -11
- package/dist/src/platforms/slack/token-extractor.js.map +1 -1
- package/dist/src/platforms/slack/types.d.ts +52 -0
- package/dist/src/platforms/slack/types.d.ts.map +1 -1
- package/dist/src/platforms/slack/types.js.map +1 -1
- package/dist/src/platforms/teams/cli.d.ts.map +1 -0
- package/dist/{cli.js → src/platforms/teams/cli.js} +11 -10
- package/dist/src/platforms/teams/cli.js.map +1 -0
- package/dist/src/platforms/teams/client.d.ts +32 -0
- package/dist/src/platforms/teams/client.d.ts.map +1 -0
- package/dist/src/platforms/teams/client.js +202 -0
- package/dist/src/platforms/teams/client.js.map +1 -0
- package/dist/src/platforms/teams/commands/auth.d.ts +14 -0
- package/dist/src/platforms/teams/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/auth.js +176 -0
- package/dist/src/platforms/teams/commands/auth.js.map +1 -0
- package/dist/src/platforms/teams/commands/channel.d.ts +13 -0
- package/dist/src/platforms/teams/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/channel.js +97 -0
- package/dist/src/platforms/teams/commands/channel.js.map +1 -0
- package/dist/src/platforms/teams/commands/file.d.ts +12 -0
- package/dist/src/platforms/teams/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/file.js +104 -0
- package/dist/src/platforms/teams/commands/file.js.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.d.ts +5 -2
- package/dist/src/platforms/teams/commands/index.d.ts.map +1 -0
- package/dist/{commands → src/platforms/teams/commands}/index.js +5 -2
- package/dist/src/platforms/teams/commands/index.js.map +1 -0
- package/dist/src/platforms/teams/commands/message.d.ts +17 -0
- package/dist/src/platforms/teams/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/message.js +133 -0
- package/dist/src/platforms/teams/commands/message.js.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts +9 -0
- package/dist/src/platforms/teams/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/reaction.js +68 -0
- package/dist/src/platforms/teams/commands/reaction.js.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts +10 -0
- package/dist/src/platforms/teams/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/snapshot.js +85 -0
- package/dist/src/platforms/teams/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/teams/commands/team.d.ts +18 -0
- package/dist/src/platforms/teams/commands/team.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/team.js +130 -0
- package/dist/src/platforms/teams/commands/team.js.map +1 -0
- package/dist/src/platforms/teams/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/teams/commands/user.js +88 -0
- package/dist/src/platforms/teams/commands/user.js.map +1 -0
- package/dist/src/platforms/teams/credential-manager.d.ts +18 -0
- package/dist/src/platforms/teams/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/teams/credential-manager.js +81 -0
- package/dist/src/platforms/teams/credential-manager.js.map +1 -0
- package/dist/src/platforms/teams/index.d.ts +4 -0
- package/dist/src/platforms/teams/index.d.ts.map +1 -0
- package/dist/src/platforms/teams/index.js +6 -0
- package/dist/src/platforms/teams/index.js.map +1 -0
- package/dist/src/platforms/teams/token-extractor.d.ts +41 -0
- package/dist/src/platforms/teams/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/teams/token-extractor.js +360 -0
- package/dist/src/platforms/teams/token-extractor.js.map +1 -0
- package/dist/src/platforms/teams/types.d.ts +209 -0
- package/dist/src/platforms/teams/types.d.ts.map +1 -0
- package/dist/src/platforms/teams/types.js +65 -0
- package/dist/src/platforms/teams/types.js.map +1 -0
- package/dist/src/shared/utils/derived-key-cache.d.ts +20 -0
- package/dist/src/shared/utils/derived-key-cache.d.ts.map +1 -0
- package/dist/src/shared/utils/derived-key-cache.js +52 -0
- package/dist/src/shared/utils/derived-key-cache.js.map +1 -0
- package/docs/README.md +113 -0
- package/docs/biome.json +8 -0
- package/docs/bun.lock +1426 -0
- package/docs/content/docs/agent-skills.mdx +98 -0
- package/docs/content/docs/index.mdx +124 -0
- package/docs/{discord.md → content/docs/integrations/discord.mdx} +46 -21
- package/docs/content/docs/integrations/meta.json +5 -0
- package/docs/{slack.md → content/docs/integrations/slack.mdx} +5 -4
- package/docs/content/docs/integrations/teams.mdx +322 -0
- package/docs/content/docs/meta.json +8 -0
- package/docs/content/docs/quick-start.mdx +103 -0
- package/docs/eslint.config.mjs +30 -0
- package/docs/next.config.ts +10 -0
- package/docs/package.json +42 -0
- package/docs/postcss.config.mjs +7 -0
- package/docs/public/file.svg +1 -0
- package/docs/public/globe.svg +1 -0
- package/docs/public/next.svg +1 -0
- package/docs/public/vercel.svg +1 -0
- package/docs/public/window.svg +1 -0
- package/docs/source.config.ts +11 -0
- package/docs/src/app/api/search/route.ts +4 -0
- package/docs/src/app/docs/[[...slug]]/page.tsx +53 -0
- package/docs/src/app/docs/layout.tsx +21 -0
- package/docs/src/app/globals.css +10 -0
- package/docs/src/app/icon.png +0 -0
- package/docs/src/app/layout.config.tsx +7 -0
- package/docs/src/app/layout.tsx +35 -0
- package/docs/src/app/page.tsx +489 -0
- package/docs/src/lib/source.ts +15 -0
- package/docs/src/mdx-components.tsx +18 -0
- package/docs/tsconfig.json +36 -0
- package/e2e/README.md +256 -0
- package/e2e/config.ts +51 -0
- package/e2e/discord.e2e.test.ts +252 -0
- package/e2e/helpers.ts +107 -0
- package/e2e/slack.e2e.test.ts +309 -0
- package/package.json +8 -4
- package/scripts/postbuild.ts +15 -0
- package/skills/agent-discord/SKILL.md +96 -30
- package/skills/agent-discord/references/authentication.md +27 -27
- package/skills/agent-discord/references/common-patterns.md +15 -15
- package/skills/agent-discord/templates/post-message.sh +6 -6
- package/skills/agent-discord/templates/{guild-summary.sh → server-summary.sh} +20 -20
- package/skills/agent-slack/SKILL.md +53 -0
- package/skills/agent-teams/SKILL.md +292 -0
- package/skills/agent-teams/references/authentication.md +375 -0
- package/skills/agent-teams/references/common-patterns.md +596 -0
- package/skills/agent-teams/templates/monitor-channel.sh +239 -0
- package/skills/agent-teams/templates/post-message.sh +224 -0
- package/skills/agent-teams/templates/team-summary.sh +210 -0
- package/src/cli.ts +4 -0
- package/src/platforms/discord/cli.ts +3 -3
- package/src/platforms/discord/client.test.ts +15 -15
- package/src/platforms/discord/client.ts +163 -17
- package/src/platforms/discord/commands/auth.test.ts +53 -37
- package/src/platforms/discord/commands/auth.ts +16 -16
- package/src/platforms/discord/commands/channel.test.ts +58 -46
- package/src/platforms/discord/commands/channel.ts +4 -4
- package/src/platforms/discord/commands/dm.test.ts +146 -0
- package/src/platforms/discord/commands/dm.ts +85 -0
- package/src/platforms/discord/commands/file.test.ts +40 -53
- package/src/platforms/discord/commands/friend.test.ts +134 -0
- package/src/platforms/discord/commands/friend.ts +45 -0
- package/src/platforms/discord/commands/index.ts +1 -1
- package/src/platforms/discord/commands/member.test.ts +98 -0
- package/src/platforms/discord/commands/member.ts +59 -0
- package/src/platforms/discord/commands/mention.test.ts +129 -0
- package/src/platforms/discord/commands/mention.ts +59 -0
- package/src/platforms/discord/commands/message.test.ts +139 -44
- package/src/platforms/discord/commands/message.ts +134 -1
- package/src/platforms/discord/commands/note.test.ts +84 -0
- package/src/platforms/discord/commands/note.ts +73 -0
- package/src/platforms/discord/commands/profile.test.ts +107 -0
- package/src/platforms/discord/commands/profile.ts +55 -0
- package/src/platforms/discord/commands/reaction.test.ts +54 -42
- package/src/platforms/discord/commands/server.test.ts +137 -0
- package/src/platforms/discord/commands/{guild.ts → server.ts} +31 -31
- package/src/platforms/discord/commands/snapshot.test.ts +1 -1
- package/src/platforms/discord/commands/snapshot.ts +10 -10
- package/src/platforms/discord/commands/thread.test.ts +121 -0
- package/src/platforms/discord/commands/thread.ts +92 -0
- package/src/platforms/discord/commands/user.test.ts +8 -8
- package/src/platforms/discord/commands/user.ts +16 -5
- package/src/platforms/discord/credential-manager.test.ts +137 -136
- package/src/platforms/discord/credential-manager.ts +35 -26
- package/src/platforms/discord/super-properties.ts +55 -0
- package/src/platforms/discord/token-extractor.test.ts +133 -383
- package/src/platforms/discord/token-extractor.ts +37 -3
- package/src/platforms/discord/types.test.ts +8 -8
- package/src/platforms/discord/types.ts +144 -8
- package/{tests → src/platforms/slack}/cli.test.ts +3 -3
- package/src/platforms/slack/cli.ts +10 -0
- package/{tests/slack-client.test.ts → src/platforms/slack/client.test.ts} +1 -1
- package/src/platforms/slack/client.ts +172 -1
- package/src/platforms/slack/commands/activity.test.ts +147 -0
- package/src/platforms/slack/commands/activity.ts +65 -0
- package/{tests → src/platforms/slack}/commands/auth.test.ts +25 -13
- package/{tests → src/platforms/slack}/commands/channel.test.ts +2 -2
- package/src/platforms/slack/commands/drafts.test.ts +136 -0
- package/src/platforms/slack/commands/drafts.ts +62 -0
- package/{tests → src/platforms/slack}/commands/file.test.ts +2 -2
- package/src/platforms/slack/commands/index.ts +5 -0
- package/{tests → src/platforms/slack}/commands/message.test.ts +2 -2
- package/{tests → src/platforms/slack}/commands/reaction.test.ts +1 -1
- package/src/platforms/slack/commands/saved.test.ts +140 -0
- package/src/platforms/slack/commands/saved.ts +71 -0
- package/src/platforms/slack/commands/sections.test.ts +80 -0
- package/src/platforms/slack/commands/sections.ts +50 -0
- package/{tests → src/platforms/slack}/commands/snapshot.test.ts +117 -105
- package/src/platforms/slack/commands/unread.test.ts +139 -0
- package/src/platforms/slack/commands/unread.ts +129 -0
- package/{tests → src/platforms/slack}/commands/user.test.ts +3 -3
- package/{tests → src/platforms/slack}/commands/workspace.test.ts +44 -95
- package/{tests → src/platforms/slack}/credential-manager.test.ts +2 -2
- package/src/platforms/slack/credential-manager.ts +22 -7
- package/src/platforms/slack/token-extractor-node-test.ts +40 -0
- package/src/platforms/slack/token-extractor-node.test.ts +10 -0
- package/src/platforms/slack/token-extractor.ts +93 -12
- package/{tests → src/platforms/slack}/types.test.ts +1 -1
- package/src/platforms/slack/types.ts +58 -0
- package/src/platforms/teams/cli.ts +36 -0
- package/src/platforms/teams/client.test.ts +500 -0
- package/src/platforms/teams/client.ts +365 -0
- package/src/platforms/teams/commands/auth.test.ts +99 -0
- package/src/platforms/teams/commands/auth.ts +232 -0
- package/src/platforms/teams/commands/channel.test.ts +147 -0
- package/src/platforms/teams/commands/channel.ts +129 -0
- package/src/platforms/teams/commands/file.test.ts +88 -0
- package/src/platforms/teams/commands/file.ts +144 -0
- package/src/platforms/teams/commands/index.ts +12 -0
- package/src/platforms/teams/commands/message.test.ts +110 -0
- package/src/platforms/teams/commands/message.ts +188 -0
- package/src/platforms/teams/commands/reaction.test.ts +87 -0
- package/src/platforms/teams/commands/reaction.ts +104 -0
- package/src/platforms/teams/commands/snapshot.test.ts +35 -0
- package/src/platforms/teams/commands/snapshot.ts +115 -0
- package/src/platforms/teams/commands/team.test.ts +157 -0
- package/src/platforms/teams/commands/team.ts +164 -0
- package/src/platforms/teams/commands/user.test.ts +83 -0
- package/src/platforms/teams/commands/user.ts +112 -0
- package/src/platforms/teams/credential-manager.test.ts +178 -0
- package/src/platforms/teams/credential-manager.ts +92 -0
- package/src/platforms/teams/index.ts +5 -0
- package/src/platforms/teams/token-extractor.test.ts +429 -0
- package/src/platforms/teams/token-extractor.ts +490 -0
- package/src/platforms/teams/types.test.ts +226 -0
- package/src/platforms/teams/types.ts +140 -0
- package/src/shared/utils/derived-key-cache.test.ts +136 -0
- package/src/shared/utils/derived-key-cache.ts +63 -0
- package/tsconfig.json +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -3
- package/dist/commands/auth.d.ts.map +0 -1
- package/dist/commands/auth.js +0 -140
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/channel.d.ts +0 -3
- package/dist/commands/channel.d.ts.map +0 -1
- package/dist/commands/channel.js +0 -118
- package/dist/commands/channel.js.map +0 -1
- package/dist/commands/file.d.ts +0 -3
- package/dist/commands/file.d.ts.map +0 -1
- package/dist/commands/file.js +0 -113
- package/dist/commands/file.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/message.d.ts +0 -3
- package/dist/commands/message.d.ts.map +0 -1
- package/dist/commands/message.js +0 -214
- package/dist/commands/message.js.map +0 -1
- package/dist/commands/reaction.d.ts +0 -3
- package/dist/commands/reaction.d.ts.map +0 -1
- package/dist/commands/reaction.js +0 -100
- package/dist/commands/reaction.js.map +0 -1
- package/dist/commands/snapshot.d.ts +0 -3
- package/dist/commands/snapshot.d.ts.map +0 -1
- package/dist/commands/snapshot.js +0 -88
- package/dist/commands/snapshot.js.map +0 -1
- package/dist/commands/user.d.ts.map +0 -1
- package/dist/commands/user.js +0 -96
- package/dist/commands/user.js.map +0 -1
- package/dist/commands/workspace.d.ts +0 -3
- package/dist/commands/workspace.d.ts.map +0 -1
- package/dist/commands/workspace.js +0 -89
- package/dist/commands/workspace.js.map +0 -1
- package/dist/lib/credential-manager.d.ts +0 -13
- package/dist/lib/credential-manager.d.ts.map +0 -1
- package/dist/lib/credential-manager.js +0 -58
- package/dist/lib/credential-manager.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -3
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/ref-manager.d.ts +0 -26
- package/dist/lib/ref-manager.d.ts.map +0 -1
- package/dist/lib/ref-manager.js +0 -92
- package/dist/lib/ref-manager.js.map +0 -1
- package/dist/lib/slack-client.d.ts +0 -37
- package/dist/lib/slack-client.d.ts.map +0 -1
- package/dist/lib/slack-client.js +0 -379
- package/dist/lib/slack-client.js.map +0 -1
- package/dist/lib/token-extractor.d.ts +0 -28
- package/dist/lib/token-extractor.d.ts.map +0 -1
- package/dist/lib/token-extractor.js +0 -401
- package/dist/lib/token-extractor.js.map +0 -1
- package/dist/src/platforms/discord/client.test.d.ts +0 -2
- package/dist/src/platforms/discord/client.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/client.test.js +0 -367
- package/dist/src/platforms/discord/client.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/auth.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/auth.test.js +0 -65
- package/dist/src/platforms/discord/commands/auth.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/channel.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/channel.test.js +0 -136
- package/dist/src/platforms/discord/commands/channel.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/file.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/file.test.js +0 -83
- package/dist/src/platforms/discord/commands/file.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/guild.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/guild.test.js +0 -100
- package/dist/src/platforms/discord/commands/guild.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/message.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/message.test.js +0 -91
- package/dist/src/platforms/discord/commands/message.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/reaction.test.js +0 -115
- package/dist/src/platforms/discord/commands/reaction.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/snapshot.test.js +0 -25
- package/dist/src/platforms/discord/commands/snapshot.test.js.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.d.ts +0 -2
- package/dist/src/platforms/discord/commands/user.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/commands/user.test.js +0 -103
- package/dist/src/platforms/discord/commands/user.test.js.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.d.ts +0 -2
- package/dist/src/platforms/discord/credential-manager.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/credential-manager.test.js +0 -136
- package/dist/src/platforms/discord/credential-manager.test.js.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.d.ts +0 -2
- package/dist/src/platforms/discord/token-extractor.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/token-extractor.test.js +0 -789
- package/dist/src/platforms/discord/token-extractor.test.js.map +0 -1
- package/dist/src/platforms/discord/types.test.d.ts +0 -2
- package/dist/src/platforms/discord/types.test.d.ts.map +0 -1
- package/dist/src/platforms/discord/types.test.js +0 -211
- package/dist/src/platforms/discord/types.test.js.map +0 -1
- package/dist/src/shared/utils/concurrency.test.d.ts +0 -2
- package/dist/src/shared/utils/concurrency.test.d.ts.map +0 -1
- package/dist/src/shared/utils/concurrency.test.js +0 -39
- package/dist/src/shared/utils/concurrency.test.js.map +0 -1
- package/dist/tests/cli.test.d.ts +0 -2
- package/dist/tests/cli.test.d.ts.map +0 -1
- package/dist/tests/cli.test.js +0 -83
- package/dist/tests/cli.test.js.map +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +0 -3
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +0 -1
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
- package/dist/tests/commands/auth.test.d.ts +0 -2
- package/dist/tests/commands/auth.test.d.ts.map +0 -1
- package/dist/tests/commands/auth.test.js +0 -304
- package/dist/tests/commands/auth.test.js.map +0 -1
- package/dist/tests/commands/channel.test.d.ts +0 -2
- package/dist/tests/commands/channel.test.d.ts.map +0 -1
- package/dist/tests/commands/channel.test.js +0 -166
- package/dist/tests/commands/channel.test.js.map +0 -1
- package/dist/tests/commands/file.test.d.ts +0 -2
- package/dist/tests/commands/file.test.d.ts.map +0 -1
- package/dist/tests/commands/file.test.js +0 -175
- package/dist/tests/commands/file.test.js.map +0 -1
- package/dist/tests/commands/message.test.d.ts +0 -2
- package/dist/tests/commands/message.test.d.ts.map +0 -1
- package/dist/tests/commands/message.test.js +0 -293
- package/dist/tests/commands/message.test.js.map +0 -1
- package/dist/tests/commands/reaction.test.d.ts +0 -2
- package/dist/tests/commands/reaction.test.d.ts.map +0 -1
- package/dist/tests/commands/reaction.test.js +0 -84
- package/dist/tests/commands/reaction.test.js.map +0 -1
- package/dist/tests/commands/snapshot.test.d.ts +0 -2
- package/dist/tests/commands/snapshot.test.d.ts.map +0 -1
- package/dist/tests/commands/snapshot.test.js +0 -280
- package/dist/tests/commands/snapshot.test.js.map +0 -1
- package/dist/tests/commands/user.test.d.ts +0 -2
- package/dist/tests/commands/user.test.d.ts.map +0 -1
- package/dist/tests/commands/user.test.js +0 -117
- package/dist/tests/commands/user.test.js.map +0 -1
- package/dist/tests/commands/workspace.test.d.ts +0 -2
- package/dist/tests/commands/workspace.test.d.ts.map +0 -1
- package/dist/tests/commands/workspace.test.js +0 -453
- package/dist/tests/commands/workspace.test.js.map +0 -1
- package/dist/tests/credential-manager.test.d.ts +0 -2
- package/dist/tests/credential-manager.test.d.ts.map +0 -1
- package/dist/tests/credential-manager.test.js +0 -199
- package/dist/tests/credential-manager.test.js.map +0 -1
- package/dist/tests/slack-client.test.d.ts +0 -2
- package/dist/tests/slack-client.test.d.ts.map +0 -1
- package/dist/tests/slack-client.test.js +0 -741
- package/dist/tests/slack-client.test.js.map +0 -1
- package/dist/tests/types.test.d.ts +0 -2
- package/dist/tests/types.test.d.ts.map +0 -1
- package/dist/tests/types.test.js +0 -215
- package/dist/tests/types.test.js.map +0 -1
- package/dist/types/index.d.ts +0 -369
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -92
- package/dist/types/index.js.map +0 -1
- package/dist/utils/error-handler.d.ts +0 -2
- package/dist/utils/error-handler.d.ts.map +0 -1
- package/dist/utils/error-handler.js +0 -5
- package/dist/utils/error-handler.js.map +0 -1
- package/dist/utils/output.d.ts +0 -2
- package/dist/utils/output.d.ts.map +0 -1
- package/dist/utils/output.js +0 -4
- package/dist/utils/output.js.map +0 -1
- package/src/platforms/discord/commands/guild.test.ts +0 -117
- /package/dist/{cli.d.ts → src/platforms/teams/cli.d.ts} +0 -0
- /package/dist/{commands → src/platforms/teams/commands}/user.d.ts +0 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { describe, test, expect, beforeAll, afterEach } from 'bun:test'
|
|
2
|
+
import {
|
|
3
|
+
runCLI, parseJSON, generateTestId, createTestMessage,
|
|
4
|
+
deleteTestMessage, waitForRateLimit, cleanupMessages
|
|
5
|
+
} from './helpers'
|
|
6
|
+
import {
|
|
7
|
+
SLACK_TEST_CHANNEL, SLACK_TEST_CHANNEL_ID,
|
|
8
|
+
validateSlackEnvironment
|
|
9
|
+
} from './config'
|
|
10
|
+
|
|
11
|
+
// Track messages created during tests for cleanup
|
|
12
|
+
let testMessages: string[] = []
|
|
13
|
+
|
|
14
|
+
describe('Slack E2E Tests', () => {
|
|
15
|
+
beforeAll(async () => {
|
|
16
|
+
// Validate we're in the correct workspace
|
|
17
|
+
await validateSlackEnvironment()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
afterEach(async () => {
|
|
21
|
+
if (testMessages.length > 0) {
|
|
22
|
+
await cleanupMessages('slack', SLACK_TEST_CHANNEL_ID, testMessages)
|
|
23
|
+
testMessages = []
|
|
24
|
+
}
|
|
25
|
+
await waitForRateLimit()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
describe('auth', () => {
|
|
29
|
+
test('auth status returns authenticated workspace info', async () => {
|
|
30
|
+
const result = await runCLI('slack', ['auth', 'status'])
|
|
31
|
+
expect(result.exitCode).toBe(0)
|
|
32
|
+
|
|
33
|
+
const data = parseJSON<{ workspace_id: string; workspace_name: string }>(result.stdout)
|
|
34
|
+
expect(data).not.toBeNull()
|
|
35
|
+
expect(data?.workspace_id).toBeTruthy()
|
|
36
|
+
expect(data?.workspace_name).toBeTruthy()
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
describe('workspace', () => {
|
|
41
|
+
test('workspace list returns array', async () => {
|
|
42
|
+
const result = await runCLI('slack', ['workspace', 'list'])
|
|
43
|
+
expect(result.exitCode).toBe(0)
|
|
44
|
+
|
|
45
|
+
const data = parseJSON<Array<{ id: string; name: string }>>(result.stdout)
|
|
46
|
+
expect(Array.isArray(data)).toBe(true)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
test('workspace current returns current workspace', async () => {
|
|
50
|
+
const result = await runCLI('slack', ['workspace', 'current'])
|
|
51
|
+
expect(result.exitCode).toBe(0)
|
|
52
|
+
|
|
53
|
+
const data = parseJSON<{ workspace_id: string }>(result.stdout)
|
|
54
|
+
expect(data?.workspace_id).toBeTruthy()
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
describe('message', () => {
|
|
59
|
+
test('message send creates message and returns ts', async () => {
|
|
60
|
+
const testId = generateTestId()
|
|
61
|
+
const result = await runCLI('slack', ['message', 'send', SLACK_TEST_CHANNEL_ID, `Test message ${testId}`])
|
|
62
|
+
expect(result.exitCode).toBe(0)
|
|
63
|
+
|
|
64
|
+
const data = parseJSON<{ ts: string }>(result.stdout)
|
|
65
|
+
expect(data?.ts).toBeTruthy()
|
|
66
|
+
|
|
67
|
+
if (data?.ts) testMessages.push(data.ts)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
test('message list returns messages array', async () => {
|
|
71
|
+
const result = await runCLI('slack', ['message', 'list', SLACK_TEST_CHANNEL_ID, '--limit', '5'])
|
|
72
|
+
expect(result.exitCode).toBe(0)
|
|
73
|
+
|
|
74
|
+
const data = parseJSON<Array<{ ts: string }>>(result.stdout)
|
|
75
|
+
expect(Array.isArray(data)).toBe(true)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
test('message get retrieves specific message', async () => {
|
|
79
|
+
const testId = generateTestId()
|
|
80
|
+
const { id: ts } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Get test ${testId}`)
|
|
81
|
+
testMessages.push(ts)
|
|
82
|
+
|
|
83
|
+
await waitForRateLimit()
|
|
84
|
+
|
|
85
|
+
const result = await runCLI('slack', ['message', 'get', SLACK_TEST_CHANNEL_ID, ts])
|
|
86
|
+
expect(result.exitCode).toBe(0)
|
|
87
|
+
|
|
88
|
+
const data = parseJSON<{ text: string }>(result.stdout)
|
|
89
|
+
expect(data?.text).toContain(testId)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
test('message update modifies message', async () => {
|
|
93
|
+
const testId = generateTestId()
|
|
94
|
+
const { id: ts } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Original ${testId}`)
|
|
95
|
+
testMessages.push(ts)
|
|
96
|
+
|
|
97
|
+
await waitForRateLimit()
|
|
98
|
+
|
|
99
|
+
const result = await runCLI('slack', ['message', 'update', SLACK_TEST_CHANNEL_ID, ts, `Updated ${testId}`])
|
|
100
|
+
expect(result.exitCode).toBe(0)
|
|
101
|
+
|
|
102
|
+
await waitForRateLimit()
|
|
103
|
+
const getResult = await runCLI('slack', ['message', 'get', SLACK_TEST_CHANNEL_ID, ts])
|
|
104
|
+
const data = parseJSON<{ text: string }>(getResult.stdout)
|
|
105
|
+
expect(data?.text).toContain('Updated')
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
test('message search finds messages', async () => {
|
|
109
|
+
const result = await runCLI('slack', ['message', 'search', 'test', '--limit', '5'])
|
|
110
|
+
expect(result.exitCode).toBe(0)
|
|
111
|
+
|
|
112
|
+
const data = parseJSON<Array<{ ts: string }>>(result.stdout)
|
|
113
|
+
expect(Array.isArray(data)).toBe(true)
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
test('message send with thread creates reply', async () => {
|
|
117
|
+
const testId = generateTestId()
|
|
118
|
+
const { id: parentTs } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Parent ${testId}`)
|
|
119
|
+
testMessages.push(parentTs)
|
|
120
|
+
|
|
121
|
+
await waitForRateLimit()
|
|
122
|
+
|
|
123
|
+
const result = await runCLI('slack', ['message', 'send', SLACK_TEST_CHANNEL_ID, `Reply ${testId}`, '--thread', parentTs])
|
|
124
|
+
expect(result.exitCode).toBe(0)
|
|
125
|
+
|
|
126
|
+
const data = parseJSON<{ ts: string; thread_ts: string }>(result.stdout)
|
|
127
|
+
expect(data?.thread_ts).toBe(parentTs)
|
|
128
|
+
|
|
129
|
+
if (data?.ts) testMessages.push(data.ts)
|
|
130
|
+
}, 30000)
|
|
131
|
+
|
|
132
|
+
test('message replies gets thread replies', async () => {
|
|
133
|
+
const testId = generateTestId()
|
|
134
|
+
const { id: parentTs } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Thread parent ${testId}`)
|
|
135
|
+
testMessages.push(parentTs)
|
|
136
|
+
|
|
137
|
+
await waitForRateLimit()
|
|
138
|
+
|
|
139
|
+
await runCLI('slack', ['message', 'send', SLACK_TEST_CHANNEL_ID, `Thread reply ${testId}`, '--thread', parentTs])
|
|
140
|
+
|
|
141
|
+
await waitForRateLimit()
|
|
142
|
+
|
|
143
|
+
const result = await runCLI('slack', ['message', 'replies', SLACK_TEST_CHANNEL_ID, parentTs])
|
|
144
|
+
expect(result.exitCode).toBe(0)
|
|
145
|
+
|
|
146
|
+
const data = parseJSON<Array<{ ts: string }>>(result.stdout)
|
|
147
|
+
expect(Array.isArray(data)).toBe(true)
|
|
148
|
+
expect(data?.length).toBeGreaterThanOrEqual(1)
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
test('message delete removes message', async () => {
|
|
152
|
+
const testId = generateTestId()
|
|
153
|
+
const { id: ts } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Delete me ${testId}`)
|
|
154
|
+
|
|
155
|
+
await waitForRateLimit()
|
|
156
|
+
|
|
157
|
+
const result = await runCLI('slack', ['message', 'delete', SLACK_TEST_CHANNEL_ID, ts, '--force'])
|
|
158
|
+
expect(result.exitCode).toBe(0)
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
describe('channel', () => {
|
|
163
|
+
test('channel list returns channels array', async () => {
|
|
164
|
+
const result = await runCLI('slack', ['channel', 'list'])
|
|
165
|
+
expect(result.exitCode).toBe(0)
|
|
166
|
+
|
|
167
|
+
const data = parseJSON<Array<{ id: string; name: string }>>(result.stdout)
|
|
168
|
+
expect(Array.isArray(data)).toBe(true)
|
|
169
|
+
expect(data?.length).toBeGreaterThan(0)
|
|
170
|
+
})
|
|
171
|
+
|
|
172
|
+
test('channel list --type public filters channels', async () => {
|
|
173
|
+
const result = await runCLI('slack', ['channel', 'list', '--type', 'public'])
|
|
174
|
+
expect(result.exitCode).toBe(0)
|
|
175
|
+
|
|
176
|
+
const data = parseJSON<Array<{ is_private: boolean }>>(result.stdout)
|
|
177
|
+
expect(Array.isArray(data)).toBe(true)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
test('channel info returns channel details', async () => {
|
|
181
|
+
const result = await runCLI('slack', ['channel', 'info', SLACK_TEST_CHANNEL_ID])
|
|
182
|
+
expect(result.exitCode).toBe(0)
|
|
183
|
+
|
|
184
|
+
const data = parseJSON<{ id: string; name: string }>(result.stdout)
|
|
185
|
+
expect(data?.id).toBeTruthy()
|
|
186
|
+
expect(data?.name).toBe('e2e-test')
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
describe('user', () => {
|
|
191
|
+
test('user list returns users array', async () => {
|
|
192
|
+
const result = await runCLI('slack', ['user', 'list'])
|
|
193
|
+
expect(result.exitCode).toBe(0)
|
|
194
|
+
|
|
195
|
+
const data = parseJSON<Array<{ id: string }>>(result.stdout)
|
|
196
|
+
expect(Array.isArray(data)).toBe(true)
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
test('user me returns current user', async () => {
|
|
200
|
+
const result = await runCLI('slack', ['user', 'me'])
|
|
201
|
+
expect(result.exitCode).toBe(0)
|
|
202
|
+
|
|
203
|
+
const data = parseJSON<{ id: string; name: string }>(result.stdout)
|
|
204
|
+
expect(data?.id).toBeTruthy()
|
|
205
|
+
expect(data?.name).toBeTruthy()
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
test('user info returns user details', async () => {
|
|
209
|
+
// First get current user ID
|
|
210
|
+
const meResult = await runCLI('slack', ['user', 'me'])
|
|
211
|
+
const me = parseJSON<{ id: string }>(meResult.stdout)
|
|
212
|
+
expect(me?.id).toBeTruthy()
|
|
213
|
+
|
|
214
|
+
await waitForRateLimit()
|
|
215
|
+
|
|
216
|
+
// Get user info
|
|
217
|
+
const result = await runCLI('slack', ['user', 'info', me!.id])
|
|
218
|
+
expect(result.exitCode).toBe(0)
|
|
219
|
+
|
|
220
|
+
const data = parseJSON<{ id: string }>(result.stdout)
|
|
221
|
+
expect(data?.id).toBe(me?.id)
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
describe('reaction', () => {
|
|
226
|
+
test('reaction add/list/remove lifecycle', async () => {
|
|
227
|
+
const testId = generateTestId()
|
|
228
|
+
const { id: ts } = await createTestMessage('slack', SLACK_TEST_CHANNEL_ID, `Reaction test ${testId}`)
|
|
229
|
+
testMessages.push(ts)
|
|
230
|
+
|
|
231
|
+
await waitForRateLimit(2000)
|
|
232
|
+
|
|
233
|
+
const addResult = await runCLI('slack', ['reaction', 'add', SLACK_TEST_CHANNEL_ID, ts, 'thumbsup'])
|
|
234
|
+
expect(addResult.exitCode).toBe(0)
|
|
235
|
+
|
|
236
|
+
await waitForRateLimit(2000)
|
|
237
|
+
|
|
238
|
+
const listResult = await runCLI('slack', ['reaction', 'list', SLACK_TEST_CHANNEL_ID, ts])
|
|
239
|
+
expect(listResult.exitCode).toBe(0)
|
|
240
|
+
|
|
241
|
+
const data = parseJSON<{ reactions: Array<{ name: string }> }>(listResult.stdout)
|
|
242
|
+
expect(Array.isArray(data?.reactions)).toBe(true)
|
|
243
|
+
|
|
244
|
+
await waitForRateLimit(2000)
|
|
245
|
+
|
|
246
|
+
const removeResult = await runCLI('slack', ['reaction', 'remove', SLACK_TEST_CHANNEL_ID, ts, 'thumbsup'])
|
|
247
|
+
expect(removeResult.exitCode).toBe(0)
|
|
248
|
+
}, 15000)
|
|
249
|
+
})
|
|
250
|
+
|
|
251
|
+
describe('file', () => {
|
|
252
|
+
test('file list returns files array', async () => {
|
|
253
|
+
const result = await runCLI('slack', ['file', 'list'])
|
|
254
|
+
expect(result.exitCode).toBe(0)
|
|
255
|
+
|
|
256
|
+
const data = parseJSON<Array<{ id: string }>>(result.stdout)
|
|
257
|
+
expect(Array.isArray(data)).toBe(true)
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
test.skip('file upload uploads file', async () => {
|
|
261
|
+
const testId = generateTestId()
|
|
262
|
+
const testFilePath = `/tmp/slack-e2e-${testId}.txt`
|
|
263
|
+
await Bun.write(testFilePath, `E2E test file content ${testId}`)
|
|
264
|
+
|
|
265
|
+
try {
|
|
266
|
+
const result = await runCLI('slack', ['file', 'upload', SLACK_TEST_CHANNEL_ID, testFilePath])
|
|
267
|
+
expect(result.exitCode).toBe(0)
|
|
268
|
+
|
|
269
|
+
const data = parseJSON<{ id: string }>(result.stdout)
|
|
270
|
+
expect(data?.id).toBeTruthy()
|
|
271
|
+
|
|
272
|
+
if (data?.id) {
|
|
273
|
+
await waitForRateLimit()
|
|
274
|
+
const infoResult = await runCLI('slack', ['file', 'info', data.id])
|
|
275
|
+
expect(infoResult.exitCode).toBe(0)
|
|
276
|
+
}
|
|
277
|
+
} finally {
|
|
278
|
+
await Bun.$`rm -f ${testFilePath}`.quiet()
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
})
|
|
282
|
+
|
|
283
|
+
describe('snapshot', () => {
|
|
284
|
+
test('snapshot returns full workspace data', async () => {
|
|
285
|
+
const result = await runCLI('slack', ['snapshot', '--limit', '2'])
|
|
286
|
+
expect(result.exitCode).toBe(0)
|
|
287
|
+
|
|
288
|
+
const data = parseJSON<{ channels: unknown[]; users: unknown[] }>(result.stdout)
|
|
289
|
+
expect(data?.channels).toBeDefined()
|
|
290
|
+
expect(data?.users).toBeDefined()
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
test('snapshot --channels-only returns only channels', async () => {
|
|
294
|
+
const result = await runCLI('slack', ['snapshot', '--channels-only'])
|
|
295
|
+
expect(result.exitCode).toBe(0)
|
|
296
|
+
|
|
297
|
+
const data = parseJSON<{ channels: unknown[] }>(result.stdout)
|
|
298
|
+
expect(data?.channels).toBeDefined()
|
|
299
|
+
})
|
|
300
|
+
|
|
301
|
+
test('snapshot --users-only returns only users', async () => {
|
|
302
|
+
const result = await runCLI('slack', ['snapshot', '--users-only'])
|
|
303
|
+
expect(result.exitCode).toBe(0)
|
|
304
|
+
|
|
305
|
+
const data = parseJSON<{ users: unknown[] }>(result.stdout)
|
|
306
|
+
expect(data?.users).toBeDefined()
|
|
307
|
+
})
|
|
308
|
+
})
|
|
309
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-messenger",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Multi-platform messaging CLI for AI agents (Slack, Discord, Teams)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/cli.js",
|
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
"agent-messenger": "./src/cli.ts",
|
|
10
10
|
"amsg": "./src/cli.ts",
|
|
11
11
|
"agent-slack": "./src/platforms/slack/cli.ts",
|
|
12
|
-
"agent-discord": "./src/platforms/discord/cli.ts"
|
|
12
|
+
"agent-discord": "./src/platforms/discord/cli.ts",
|
|
13
|
+
"agent-teams": "./src/platforms/teams/cli.ts"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
|
-
"build": "tsc
|
|
16
|
-
"
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"postbuild": "bun scripts/postbuild.ts",
|
|
18
|
+
"test": "bun test src/",
|
|
19
|
+
"test:e2e": "bun test e2e/",
|
|
17
20
|
"typecheck": "tsc --noEmit",
|
|
18
21
|
"lint": "biome check .",
|
|
19
22
|
"format": "biome format --write .",
|
|
@@ -32,6 +35,7 @@
|
|
|
32
35
|
"@types/better-sqlite3": "^7.6.8",
|
|
33
36
|
"@types/bun": "latest",
|
|
34
37
|
"@types/node": "^20.10.6",
|
|
38
|
+
"tsx": "^4.21.0",
|
|
35
39
|
"typescript": "^5.9.3"
|
|
36
40
|
}
|
|
37
41
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
2
|
+
|
|
3
|
+
const cliFiles = [
|
|
4
|
+
'dist/src/cli.js',
|
|
5
|
+
'dist/src/platforms/slack/cli.js',
|
|
6
|
+
'dist/src/platforms/discord/cli.js',
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
for (const file of cliFiles) {
|
|
10
|
+
const content = readFileSync(file, 'utf8')
|
|
11
|
+
const updated = content.replace('#!/usr/bin/env bun', '#!/usr/bin/env node')
|
|
12
|
+
writeFileSync(file, updated)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
console.log(`Updated shebang in ${cliFiles.length} CLI files`)
|
|
@@ -6,7 +6,7 @@ allowed-tools: Bash(agent-discord:*)
|
|
|
6
6
|
|
|
7
7
|
# Agent Discord
|
|
8
8
|
|
|
9
|
-
A TypeScript CLI tool that enables AI agents and humans to interact with Discord servers through a simple command interface. Features seamless token extraction from the Discord desktop app and multi-
|
|
9
|
+
A TypeScript CLI tool that enables AI agents and humans to interact with Discord servers through a simple command interface. Features seamless token extraction from the Discord desktop app and multi-server support.
|
|
10
10
|
|
|
11
11
|
## Quick Start
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ A TypeScript CLI tool that enables AI agents and humans to interact with Discord
|
|
|
14
14
|
# Extract credentials from Discord desktop app (zero-config)
|
|
15
15
|
agent-discord auth extract
|
|
16
16
|
|
|
17
|
-
# Get
|
|
17
|
+
# Get server snapshot
|
|
18
18
|
agent-discord snapshot
|
|
19
19
|
|
|
20
20
|
# Send a message
|
|
@@ -42,20 +42,20 @@ This command:
|
|
|
42
42
|
- Auto-detects your platform (macOS/Linux/Windows)
|
|
43
43
|
- Extracts user token from Discord desktop app's LevelDB storage
|
|
44
44
|
- Validates token against Discord API before saving
|
|
45
|
-
- Discovers ALL joined
|
|
45
|
+
- Discovers ALL joined servers
|
|
46
46
|
- Stores credentials securely in `~/.config/agent-messenger/`
|
|
47
47
|
|
|
48
|
-
### Multi-
|
|
48
|
+
### Multi-Server Support
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
# List all available
|
|
52
|
-
agent-discord
|
|
51
|
+
# List all available servers
|
|
52
|
+
agent-discord server list
|
|
53
53
|
|
|
54
|
-
# Switch to a different
|
|
55
|
-
agent-discord
|
|
54
|
+
# Switch to a different server
|
|
55
|
+
agent-discord server switch <server-id>
|
|
56
56
|
|
|
57
|
-
# Show current
|
|
58
|
-
agent-discord
|
|
57
|
+
# Show current server
|
|
58
|
+
agent-discord server current
|
|
59
59
|
|
|
60
60
|
# Check auth status
|
|
61
61
|
agent-discord auth status
|
|
@@ -80,12 +80,15 @@ agent-discord message get 1234567890123456789 9876543210987654321
|
|
|
80
80
|
|
|
81
81
|
# Delete a message
|
|
82
82
|
agent-discord message delete <channel-id> <message-id> --force
|
|
83
|
+
|
|
84
|
+
# Acknowledge/mark a message as read
|
|
85
|
+
agent-discord message ack <channel-id> <message-id>
|
|
83
86
|
```
|
|
84
87
|
|
|
85
88
|
### Channel Commands
|
|
86
89
|
|
|
87
90
|
```bash
|
|
88
|
-
# List channels in current
|
|
91
|
+
# List channels in current server (text channels only)
|
|
89
92
|
agent-discord channel list
|
|
90
93
|
|
|
91
94
|
# Get channel info
|
|
@@ -96,26 +99,26 @@ agent-discord channel info 1234567890123456789
|
|
|
96
99
|
agent-discord channel history <channel-id> --limit 100
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
###
|
|
102
|
+
### Server Commands
|
|
100
103
|
|
|
101
104
|
```bash
|
|
102
|
-
# List all
|
|
103
|
-
agent-discord
|
|
105
|
+
# List all servers
|
|
106
|
+
agent-discord server list
|
|
104
107
|
|
|
105
|
-
# Get
|
|
106
|
-
agent-discord
|
|
108
|
+
# Get server info
|
|
109
|
+
agent-discord server info <server-id>
|
|
107
110
|
|
|
108
|
-
# Switch active
|
|
109
|
-
agent-discord
|
|
111
|
+
# Switch active server
|
|
112
|
+
agent-discord server switch <server-id>
|
|
110
113
|
|
|
111
|
-
# Show current
|
|
112
|
-
agent-discord
|
|
114
|
+
# Show current server
|
|
115
|
+
agent-discord server current
|
|
113
116
|
```
|
|
114
117
|
|
|
115
118
|
### User Commands
|
|
116
119
|
|
|
117
120
|
```bash
|
|
118
|
-
# List
|
|
121
|
+
# List server members
|
|
119
122
|
agent-discord user list
|
|
120
123
|
|
|
121
124
|
# Get user info
|
|
@@ -125,6 +128,69 @@ agent-discord user info <user-id>
|
|
|
125
128
|
agent-discord user me
|
|
126
129
|
```
|
|
127
130
|
|
|
131
|
+
### DM Commands
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# List DM channels
|
|
135
|
+
agent-discord dm list
|
|
136
|
+
|
|
137
|
+
# Create a DM channel with a user
|
|
138
|
+
agent-discord dm create <user-id>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Mention Commands
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# List recent mentions
|
|
145
|
+
agent-discord mention list
|
|
146
|
+
agent-discord mention list --limit 50
|
|
147
|
+
agent-discord mention list --guild <server-id>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Friend Commands
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# List all relationships (friends, blocked, pending requests)
|
|
154
|
+
agent-discord friend list
|
|
155
|
+
agent-discord friend list --pretty
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Note Commands
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Get note for a user
|
|
162
|
+
agent-discord note get <user-id>
|
|
163
|
+
|
|
164
|
+
# Set note for a user
|
|
165
|
+
agent-discord note set <user-id> "Note content"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Profile Commands
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
# Get detailed user profile
|
|
172
|
+
agent-discord profile get <user-id>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Member Commands
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Search guild members
|
|
179
|
+
agent-discord member search <guild-id> <query>
|
|
180
|
+
agent-discord member search 1234567890123456789 "john" --limit 20
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Thread Commands
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# Create a thread in a channel
|
|
187
|
+
agent-discord thread create <channel-id> <name>
|
|
188
|
+
agent-discord thread create 1234567890123456789 "Discussion" --auto-archive-duration 1440
|
|
189
|
+
|
|
190
|
+
# Archive a thread
|
|
191
|
+
agent-discord thread archive <thread-id>
|
|
192
|
+
```
|
|
193
|
+
|
|
128
194
|
### Reaction Commands
|
|
129
195
|
|
|
130
196
|
```bash
|
|
@@ -155,7 +221,7 @@ agent-discord file info <channel-id> <file-id>
|
|
|
155
221
|
|
|
156
222
|
### Snapshot Command
|
|
157
223
|
|
|
158
|
-
Get comprehensive
|
|
224
|
+
Get comprehensive server state for AI agents:
|
|
159
225
|
|
|
160
226
|
```bash
|
|
161
227
|
# Full snapshot
|
|
@@ -170,7 +236,7 @@ agent-discord snapshot --limit 10
|
|
|
170
236
|
```
|
|
171
237
|
|
|
172
238
|
Returns JSON with:
|
|
173
|
-
-
|
|
239
|
+
- Server metadata (id, name)
|
|
174
240
|
- Channels (id, name, type, topic)
|
|
175
241
|
- Recent messages (id, content, author, timestamp)
|
|
176
242
|
- Members (id, username, global_name)
|
|
@@ -202,7 +268,7 @@ agent-discord channel list --pretty
|
|
|
202
268
|
|
|
203
269
|
| Feature | Discord | Slack |
|
|
204
270
|
|---------|---------|-------|
|
|
205
|
-
| Server terminology |
|
|
271
|
+
| Server terminology | Server | Workspace |
|
|
206
272
|
| Channel identifiers | Snowflake IDs | Channel name or ID |
|
|
207
273
|
| Message identifiers | Snowflake IDs | Timestamps (ts) |
|
|
208
274
|
| Threads | Thread ID field | Thread timestamp |
|
|
@@ -219,7 +285,7 @@ See `references/common-patterns.md` for typical AI agent workflows.
|
|
|
219
285
|
See `templates/` directory for runnable examples:
|
|
220
286
|
- `post-message.sh` - Send messages with error handling
|
|
221
287
|
- `monitor-channel.sh` - Monitor channel for new messages
|
|
222
|
-
- `
|
|
288
|
+
- `server-summary.sh` - Generate server summary
|
|
223
289
|
|
|
224
290
|
## Error Handling
|
|
225
291
|
|
|
@@ -233,7 +299,7 @@ All commands return consistent error format:
|
|
|
233
299
|
|
|
234
300
|
Common errors:
|
|
235
301
|
- `Not authenticated`: No valid token - run `auth extract`
|
|
236
|
-
- `No current
|
|
302
|
+
- `No current server set`: Run `server switch <id>` first
|
|
237
303
|
- `Message not found`: Invalid message ID
|
|
238
304
|
- `Unknown Channel`: Invalid channel ID
|
|
239
305
|
|
|
@@ -245,11 +311,11 @@ Format:
|
|
|
245
311
|
```json
|
|
246
312
|
{
|
|
247
313
|
"token": "user_token_here",
|
|
248
|
-
"
|
|
249
|
-
"
|
|
314
|
+
"current_server": "1234567890123456789",
|
|
315
|
+
"servers": {
|
|
250
316
|
"1234567890123456789": {
|
|
251
|
-
"
|
|
252
|
-
"
|
|
317
|
+
"server_id": "1234567890123456789",
|
|
318
|
+
"server_name": "My Server"
|
|
253
319
|
}
|
|
254
320
|
}
|
|
255
321
|
}
|