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
|
@@ -23,7 +23,7 @@ This command:
|
|
|
23
23
|
3. Reads the LevelDB storage containing session data
|
|
24
24
|
4. Extracts user token
|
|
25
25
|
5. Validates token against Discord API before saving
|
|
26
|
-
6. Discovers ALL joined
|
|
26
|
+
6. Discovers ALL joined servers
|
|
27
27
|
7. Stores credentials securely in `~/.config/agent-messenger/discord-credentials.json`
|
|
28
28
|
|
|
29
29
|
### Platform-Specific Paths
|
|
@@ -49,16 +49,16 @@ The tool searches within:
|
|
|
49
49
|
### What Gets Extracted
|
|
50
50
|
|
|
51
51
|
- **token**: User token (starts with a base64-encoded user ID)
|
|
52
|
-
- **
|
|
52
|
+
- **servers**: All servers you're a member of
|
|
53
53
|
|
|
54
|
-
## Multi-
|
|
54
|
+
## Multi-Server Management
|
|
55
55
|
|
|
56
|
-
### List
|
|
56
|
+
### List Servers
|
|
57
57
|
|
|
58
|
-
See all available
|
|
58
|
+
See all available servers:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
|
-
agent-discord
|
|
61
|
+
agent-discord server list
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Output:
|
|
@@ -77,22 +77,22 @@ Output:
|
|
|
77
77
|
]
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
-
### Switch
|
|
80
|
+
### Switch Server
|
|
81
81
|
|
|
82
|
-
Change the active
|
|
82
|
+
Change the active server:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
agent-discord
|
|
85
|
+
agent-discord server switch 9876543210987654321
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
All subsequent commands will use the selected
|
|
88
|
+
All subsequent commands will use the selected server until you switch again.
|
|
89
89
|
|
|
90
|
-
### Current
|
|
90
|
+
### Current Server
|
|
91
91
|
|
|
92
|
-
Check which
|
|
92
|
+
Check which server is active:
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
agent-discord
|
|
95
|
+
agent-discord server current
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
## Credential Storage
|
|
@@ -109,15 +109,15 @@ Credentials are stored in:
|
|
|
109
109
|
```json
|
|
110
110
|
{
|
|
111
111
|
"token": "user_token_here",
|
|
112
|
-
"
|
|
113
|
-
"
|
|
112
|
+
"current_server": "1234567890123456789",
|
|
113
|
+
"servers": {
|
|
114
114
|
"1234567890123456789": {
|
|
115
|
-
"
|
|
116
|
-
"
|
|
115
|
+
"server_id": "1234567890123456789",
|
|
116
|
+
"server_name": "My Server"
|
|
117
117
|
},
|
|
118
118
|
"9876543210987654321": {
|
|
119
|
-
"
|
|
120
|
-
"
|
|
119
|
+
"server_id": "9876543210987654321",
|
|
120
|
+
"server_name": "Another Server"
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
}
|
|
@@ -142,8 +142,8 @@ Output when authenticated:
|
|
|
142
142
|
{
|
|
143
143
|
"authenticated": true,
|
|
144
144
|
"user": "username",
|
|
145
|
-
"
|
|
146
|
-
"
|
|
145
|
+
"current_server": "1234567890123456789",
|
|
146
|
+
"servers_count": 5
|
|
147
147
|
}
|
|
148
148
|
```
|
|
149
149
|
|
|
@@ -190,7 +190,7 @@ This shows:
|
|
|
190
190
|
- Which Discord directory was found
|
|
191
191
|
- Token extraction progress
|
|
192
192
|
- Token validation results
|
|
193
|
-
-
|
|
193
|
+
- Server discovery details
|
|
194
194
|
|
|
195
195
|
### "Discord desktop app not found"
|
|
196
196
|
|
|
@@ -254,7 +254,7 @@ With extracted credentials, agent-discord has the same permissions as you in Dis
|
|
|
254
254
|
### Best Practices
|
|
255
255
|
|
|
256
256
|
1. **Protect credentials.json**: Never commit to version control
|
|
257
|
-
2. **Use
|
|
257
|
+
2. **Use server switching**: Keep different contexts separate
|
|
258
258
|
3. **Re-extract periodically**: Keep tokens fresh
|
|
259
259
|
4. **Revoke if compromised**: Change your Discord password to invalidate tokens
|
|
260
260
|
|
|
@@ -270,11 +270,11 @@ mkdir -p ~/.config/agent-messenger
|
|
|
270
270
|
cat > ~/.config/agent-messenger/discord-credentials.json << 'EOF'
|
|
271
271
|
{
|
|
272
272
|
"token": "YOUR_TOKEN_HERE",
|
|
273
|
-
"
|
|
274
|
-
"
|
|
273
|
+
"current_server": "1234567890123456789",
|
|
274
|
+
"servers": {
|
|
275
275
|
"1234567890123456789": {
|
|
276
|
-
"
|
|
277
|
-
"
|
|
276
|
+
"server_id": "1234567890123456789",
|
|
277
|
+
"server_name": "My Server"
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -70,7 +70,7 @@ done
|
|
|
70
70
|
|
|
71
71
|
**Limitations**: Polling-based, not real-time. For production bots, use Discord's Gateway API with a proper bot token.
|
|
72
72
|
|
|
73
|
-
## Pattern 3: Get
|
|
73
|
+
## Pattern 3: Get Server Overview
|
|
74
74
|
|
|
75
75
|
**Use case**: Understand server state before taking action
|
|
76
76
|
|
|
@@ -81,11 +81,11 @@ done
|
|
|
81
81
|
SNAPSHOT=$(agent-discord snapshot)
|
|
82
82
|
|
|
83
83
|
# Extract key information
|
|
84
|
-
|
|
84
|
+
SERVER_NAME=$(echo "$SNAPSHOT" | jq -r '.server.name')
|
|
85
85
|
CHANNEL_COUNT=$(echo "$SNAPSHOT" | jq -r '.channels | length')
|
|
86
86
|
MEMBER_COUNT=$(echo "$SNAPSHOT" | jq -r '.members | length')
|
|
87
87
|
|
|
88
|
-
echo "Server: $
|
|
88
|
+
echo "Server: $SERVER_NAME"
|
|
89
89
|
echo "Channels: $CHANNEL_COUNT"
|
|
90
90
|
echo "Members: $MEMBER_COUNT"
|
|
91
91
|
|
|
@@ -207,7 +207,7 @@ fi
|
|
|
207
207
|
CHANNEL_ID="1234567890123456789"
|
|
208
208
|
USERNAME="john"
|
|
209
209
|
|
|
210
|
-
# Get
|
|
210
|
+
# Get server members
|
|
211
211
|
USERS=$(agent-discord user list)
|
|
212
212
|
USER_ID=$(echo "$USERS" | jq -r --arg name "$USERNAME" '.[] | select(.username | contains($name)) | .id' | head -1)
|
|
213
213
|
|
|
@@ -303,26 +303,26 @@ send_with_retry "$CHANNEL_ID" "Important message!"
|
|
|
303
303
|
|
|
304
304
|
**When to use**: Production scripts, critical notifications, unreliable networks.
|
|
305
305
|
|
|
306
|
-
## Pattern 10: Switch
|
|
306
|
+
## Pattern 10: Switch Servers for Operations
|
|
307
307
|
|
|
308
308
|
**Use case**: Work with multiple Discord servers
|
|
309
309
|
|
|
310
310
|
```bash
|
|
311
311
|
#!/bin/bash
|
|
312
312
|
|
|
313
|
-
# List all
|
|
314
|
-
|
|
315
|
-
echo "Available
|
|
316
|
-
echo "$
|
|
313
|
+
# List all servers
|
|
314
|
+
SERVERS=$(agent-discord server list)
|
|
315
|
+
echo "Available servers:"
|
|
316
|
+
echo "$SERVERS" | jq -r '.[] | " \(.name) (\(.id)) \(if .current then "[current]" else "" end)"'
|
|
317
317
|
|
|
318
|
-
# Switch to a specific
|
|
319
|
-
|
|
320
|
-
if [ -n "$
|
|
321
|
-
agent-discord
|
|
322
|
-
echo "Switched to Production
|
|
318
|
+
# Switch to a specific server
|
|
319
|
+
TARGET_SERVER=$(echo "$SERVERS" | jq -r '.[] | select(.name | contains("Production")) | .id')
|
|
320
|
+
if [ -n "$TARGET_SERVER" ]; then
|
|
321
|
+
agent-discord server switch "$TARGET_SERVER"
|
|
322
|
+
echo "Switched to Production server"
|
|
323
323
|
fi
|
|
324
324
|
|
|
325
|
-
# Now operations use the new
|
|
325
|
+
# Now operations use the new server
|
|
326
326
|
agent-discord channel list
|
|
327
327
|
```
|
|
328
328
|
|
|
@@ -128,15 +128,15 @@ if echo "$AUTH_STATUS" | jq -e '.error' > /dev/null 2>&1; then
|
|
|
128
128
|
fi
|
|
129
129
|
|
|
130
130
|
USER_NAME=$(echo "$AUTH_STATUS" | jq -r '.user // "Unknown"')
|
|
131
|
-
|
|
131
|
+
SERVER_ID=$(echo "$AUTH_STATUS" | jq -r '.current_server // ""')
|
|
132
132
|
echo -e "${GREEN}Authenticated as: $USER_NAME${NC}"
|
|
133
133
|
|
|
134
|
-
if [ -z "$
|
|
135
|
-
echo -e "${RED}No
|
|
134
|
+
if [ -z "$SERVER_ID" ]; then
|
|
135
|
+
echo -e "${RED}No server selected!${NC}"
|
|
136
136
|
echo ""
|
|
137
|
-
echo "Run this to select a
|
|
138
|
-
echo " agent-discord
|
|
139
|
-
echo " agent-discord
|
|
137
|
+
echo "Run this to select a server:"
|
|
138
|
+
echo " agent-discord server list"
|
|
139
|
+
echo " agent-discord server switch <server-id>"
|
|
140
140
|
exit 1
|
|
141
141
|
fi
|
|
142
142
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
#
|
|
3
|
-
#
|
|
3
|
+
# server-summary.sh - Generate a comprehensive Discord server summary
|
|
4
4
|
#
|
|
5
5
|
# Usage:
|
|
6
|
-
# ./
|
|
6
|
+
# ./server-summary.sh [--json]
|
|
7
7
|
#
|
|
8
8
|
# Options:
|
|
9
9
|
# --json Output raw JSON instead of formatted text
|
|
10
10
|
#
|
|
11
11
|
# Example:
|
|
12
|
-
# ./
|
|
13
|
-
# ./
|
|
12
|
+
# ./server-summary.sh
|
|
13
|
+
# ./server-summary.sh --json > summary.json
|
|
14
14
|
|
|
15
15
|
set -euo pipefail
|
|
16
16
|
|
|
@@ -45,17 +45,17 @@ if echo "$AUTH_STATUS" | jq -e '.error' > /dev/null 2>&1; then
|
|
|
45
45
|
exit 1
|
|
46
46
|
fi
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
if [ -z "$
|
|
50
|
-
echo -e "${RED}No
|
|
48
|
+
CURRENT_SERVER=$(echo "$AUTH_STATUS" | jq -r '.current_server // ""')
|
|
49
|
+
if [ -z "$CURRENT_SERVER" ]; then
|
|
50
|
+
echo -e "${RED}No server selected!${NC}" >&2
|
|
51
51
|
echo "" >&2
|
|
52
|
-
echo "Run this to select a
|
|
53
|
-
echo " agent-discord
|
|
54
|
-
echo " agent-discord
|
|
52
|
+
echo "Run this to select a server:" >&2
|
|
53
|
+
echo " agent-discord server list" >&2
|
|
54
|
+
echo " agent-discord server switch <server-id>" >&2
|
|
55
55
|
exit 1
|
|
56
56
|
fi
|
|
57
57
|
|
|
58
|
-
echo -e "${YELLOW}Fetching
|
|
58
|
+
echo -e "${YELLOW}Fetching server snapshot...${NC}" >&2
|
|
59
59
|
SNAPSHOT=$(agent-discord snapshot 2>&1)
|
|
60
60
|
|
|
61
61
|
if echo "$SNAPSHOT" | jq -e '.error' > /dev/null 2>&1; then
|
|
@@ -70,8 +70,8 @@ if [ "$OUTPUT_JSON" = true ]; then
|
|
|
70
70
|
exit 0
|
|
71
71
|
fi
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
SERVER_NAME=$(echo "$SNAPSHOT" | jq -r '.server.name // "Unknown"')
|
|
74
|
+
SERVER_ID=$(echo "$SNAPSHOT" | jq -r '.server.id // "Unknown"')
|
|
75
75
|
|
|
76
76
|
CHANNELS=$(echo "$SNAPSHOT" | jq '.channels // []')
|
|
77
77
|
CHANNEL_COUNT=$(echo "$CHANNELS" | jq 'length')
|
|
@@ -87,11 +87,11 @@ MESSAGE_COUNT=$(echo "$MESSAGES" | jq 'length')
|
|
|
87
87
|
|
|
88
88
|
echo ""
|
|
89
89
|
echo -e "${BOLD}${BLUE}=====================================================${NC}"
|
|
90
|
-
echo -e "${BOLD}${BLUE} Discord
|
|
90
|
+
echo -e "${BOLD}${BLUE} Discord Server Summary${NC}"
|
|
91
91
|
echo -e "${BOLD}${BLUE}=====================================================${NC}"
|
|
92
92
|
echo ""
|
|
93
|
-
echo -e "${BOLD}
|
|
94
|
-
echo -e "${BOLD}ID:${NC} $
|
|
93
|
+
echo -e "${BOLD}Server:${NC} $SERVER_NAME"
|
|
94
|
+
echo -e "${BOLD}ID:${NC} $SERVER_ID"
|
|
95
95
|
echo ""
|
|
96
96
|
|
|
97
97
|
echo -e "${BOLD}${CYAN}Channels (${CHANNEL_COUNT} total)${NC}"
|
|
@@ -153,15 +153,15 @@ echo -e " ${GREEN}# Get user info${NC}"
|
|
|
153
153
|
FIRST_USER=$(echo "$MEMBERS" | jq -r '.[0].id // "USER_ID"')
|
|
154
154
|
echo -e " agent-discord user info $FIRST_USER"
|
|
155
155
|
echo ""
|
|
156
|
-
echo -e " ${GREEN}# Switch to another
|
|
157
|
-
echo -e " agent-discord
|
|
158
|
-
echo -e " agent-discord
|
|
156
|
+
echo -e " ${GREEN}# Switch to another server${NC}"
|
|
157
|
+
echo -e " agent-discord server list"
|
|
158
|
+
echo -e " agent-discord server switch <server-id>"
|
|
159
159
|
echo ""
|
|
160
160
|
|
|
161
161
|
echo -e "${BOLD}${BLUE}=====================================================${NC}"
|
|
162
162
|
echo ""
|
|
163
163
|
|
|
164
|
-
SNAPSHOT_FILE="
|
|
164
|
+
SNAPSHOT_FILE="server-snapshot-$(date +%Y%m%d-%H%M%S).json"
|
|
165
165
|
echo "$SNAPSHOT" > "$SNAPSHOT_FILE"
|
|
166
166
|
echo -e "${GREEN}Full snapshot saved to: $SNAPSHOT_FILE${NC}"
|
|
167
167
|
echo ""
|
|
@@ -162,6 +162,59 @@ agent-slack file list --channel general
|
|
|
162
162
|
agent-slack file info <file-id>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
### Unread Commands
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
# List unread channels
|
|
169
|
+
agent-slack unread list
|
|
170
|
+
agent-slack unread list --pretty
|
|
171
|
+
|
|
172
|
+
# Get unread counts summary
|
|
173
|
+
agent-slack unread count
|
|
174
|
+
|
|
175
|
+
# Mark channel as read
|
|
176
|
+
agent-slack mark read <channel>
|
|
177
|
+
agent-slack mark read general
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Activity Commands
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# List activity feed (mentions, reactions, replies)
|
|
184
|
+
agent-slack activity list
|
|
185
|
+
agent-slack activity list --limit 50
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Saved Items Commands
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# List saved items
|
|
192
|
+
agent-slack saved list
|
|
193
|
+
|
|
194
|
+
# Add item to saved
|
|
195
|
+
agent-slack saved add <channel> <ts>
|
|
196
|
+
agent-slack saved add general 1234567890.123456
|
|
197
|
+
|
|
198
|
+
# Remove item from saved
|
|
199
|
+
agent-slack saved remove <channel> <ts>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Drafts Commands
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# List all drafts
|
|
206
|
+
agent-slack drafts list
|
|
207
|
+
agent-slack drafts list --pretty
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Channel Sections Commands
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# List channel sections (sidebar organization)
|
|
214
|
+
agent-slack section list
|
|
215
|
+
agent-slack section list --pretty
|
|
216
|
+
```
|
|
217
|
+
|
|
165
218
|
### Snapshot Command
|
|
166
219
|
|
|
167
220
|
Get comprehensive workspace state for AI agents:
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-teams
|
|
3
|
+
description: Interact with Microsoft Teams - send messages, read channels, manage reactions
|
|
4
|
+
allowed-tools: Bash(agent-teams:*)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Agent Teams
|
|
8
|
+
|
|
9
|
+
A TypeScript CLI tool that enables AI agents and humans to interact with Microsoft Teams through a simple command interface. Features seamless token extraction from the Teams desktop app and multi-team support.
|
|
10
|
+
|
|
11
|
+
## TOKEN EXPIRY WARNING
|
|
12
|
+
|
|
13
|
+
**CRITICAL**: Microsoft Teams tokens expire in **60-90 minutes**! Unlike Discord/Slack, Teams tokens have a short lifespan. You MUST:
|
|
14
|
+
|
|
15
|
+
1. Check token validity before operations
|
|
16
|
+
2. Re-extract credentials when tokens expire
|
|
17
|
+
3. Handle `401 Unauthorized` errors gracefully
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Always check auth status first
|
|
21
|
+
agent-teams auth status
|
|
22
|
+
|
|
23
|
+
# If expired, re-extract
|
|
24
|
+
agent-teams auth extract
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Extract credentials from Teams desktop app (zero-config)
|
|
31
|
+
agent-teams auth extract
|
|
32
|
+
|
|
33
|
+
# Get team snapshot
|
|
34
|
+
agent-teams snapshot
|
|
35
|
+
|
|
36
|
+
# Send a message
|
|
37
|
+
agent-teams message send <channel-id> "Hello from AI agent!"
|
|
38
|
+
|
|
39
|
+
# List channels
|
|
40
|
+
agent-teams channel list
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Authentication
|
|
44
|
+
|
|
45
|
+
### Seamless Token Extraction
|
|
46
|
+
|
|
47
|
+
agent-teams automatically extracts your Teams credentials from the desktop app:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Just run this - no manual token copying needed
|
|
51
|
+
agent-teams auth extract
|
|
52
|
+
|
|
53
|
+
# Use --debug for troubleshooting
|
|
54
|
+
agent-teams auth extract --debug
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This command:
|
|
58
|
+
- Auto-detects your platform (macOS/Linux/Windows)
|
|
59
|
+
- Extracts skypetoken_asm from Teams desktop app's Cookies SQLite database
|
|
60
|
+
- Validates token against Teams API before saving
|
|
61
|
+
- Discovers ALL joined teams
|
|
62
|
+
- Stores credentials securely in `~/.config/agent-messenger/`
|
|
63
|
+
|
|
64
|
+
### Multi-Team Support
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# List all available teams
|
|
68
|
+
agent-teams team list
|
|
69
|
+
|
|
70
|
+
# Switch to a different team
|
|
71
|
+
agent-teams team switch <team-id>
|
|
72
|
+
|
|
73
|
+
# Show current team
|
|
74
|
+
agent-teams team current
|
|
75
|
+
|
|
76
|
+
# Check auth status (includes token expiry info)
|
|
77
|
+
agent-teams auth status
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Commands
|
|
81
|
+
|
|
82
|
+
### Message Commands
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Send a message
|
|
86
|
+
agent-teams message send <channel-id> <content>
|
|
87
|
+
agent-teams message send 19:abc123@thread.tacv2 "Hello world"
|
|
88
|
+
|
|
89
|
+
# List messages
|
|
90
|
+
agent-teams message list <channel-id>
|
|
91
|
+
agent-teams message list 19:abc123@thread.tacv2 --limit 50
|
|
92
|
+
|
|
93
|
+
# Get a single message by ID
|
|
94
|
+
agent-teams message get <channel-id> <message-id>
|
|
95
|
+
|
|
96
|
+
# Delete a message
|
|
97
|
+
agent-teams message delete <channel-id> <message-id> --force
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Channel Commands
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# List channels in current team
|
|
104
|
+
agent-teams channel list
|
|
105
|
+
|
|
106
|
+
# Get channel info
|
|
107
|
+
agent-teams channel info <channel-id>
|
|
108
|
+
agent-teams channel info 19:abc123@thread.tacv2
|
|
109
|
+
|
|
110
|
+
# Get channel history (alias for message list)
|
|
111
|
+
agent-teams channel history <channel-id> --limit 100
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Team Commands
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# List all teams
|
|
118
|
+
agent-teams team list
|
|
119
|
+
|
|
120
|
+
# Get team info
|
|
121
|
+
agent-teams team info <team-id>
|
|
122
|
+
|
|
123
|
+
# Switch active team
|
|
124
|
+
agent-teams team switch <team-id>
|
|
125
|
+
|
|
126
|
+
# Show current team
|
|
127
|
+
agent-teams team current
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### User Commands
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# List team members
|
|
134
|
+
agent-teams user list
|
|
135
|
+
|
|
136
|
+
# Get user info
|
|
137
|
+
agent-teams user info <user-id>
|
|
138
|
+
|
|
139
|
+
# Get current user
|
|
140
|
+
agent-teams user me
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Reaction Commands
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Add reaction (use emoji name)
|
|
147
|
+
agent-teams reaction add <channel-id> <message-id> <emoji>
|
|
148
|
+
agent-teams reaction add 19:abc123@thread.tacv2 1234567890 like
|
|
149
|
+
|
|
150
|
+
# Remove reaction
|
|
151
|
+
agent-teams reaction remove <channel-id> <message-id> <emoji>
|
|
152
|
+
|
|
153
|
+
# List reactions on a message
|
|
154
|
+
agent-teams reaction list <channel-id> <message-id>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### File Commands
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Upload file
|
|
161
|
+
agent-teams file upload <channel-id> <path>
|
|
162
|
+
agent-teams file upload 19:abc123@thread.tacv2 ./report.pdf
|
|
163
|
+
|
|
164
|
+
# List files in channel
|
|
165
|
+
agent-teams file list <channel-id>
|
|
166
|
+
|
|
167
|
+
# Get file info
|
|
168
|
+
agent-teams file info <channel-id> <file-id>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Snapshot Command
|
|
172
|
+
|
|
173
|
+
Get comprehensive team state for AI agents:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Full snapshot
|
|
177
|
+
agent-teams snapshot
|
|
178
|
+
|
|
179
|
+
# Filtered snapshots
|
|
180
|
+
agent-teams snapshot --channels-only
|
|
181
|
+
agent-teams snapshot --users-only
|
|
182
|
+
|
|
183
|
+
# Limit messages per channel
|
|
184
|
+
agent-teams snapshot --limit 10
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Returns JSON with:
|
|
188
|
+
- Team metadata (id, name)
|
|
189
|
+
- Channels (id, name, type, description)
|
|
190
|
+
- Recent messages (id, content, author, timestamp)
|
|
191
|
+
- Members (id, displayName, email)
|
|
192
|
+
|
|
193
|
+
## Output Format
|
|
194
|
+
|
|
195
|
+
### JSON (Default)
|
|
196
|
+
|
|
197
|
+
All commands output JSON by default for AI consumption:
|
|
198
|
+
|
|
199
|
+
```json
|
|
200
|
+
{
|
|
201
|
+
"id": "19:abc123@thread.tacv2",
|
|
202
|
+
"content": "Hello world",
|
|
203
|
+
"author": "John Doe",
|
|
204
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Pretty (Human-Readable)
|
|
209
|
+
|
|
210
|
+
Use `--pretty` flag for formatted output:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
agent-teams channel list --pretty
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Key Differences from Discord/Slack
|
|
217
|
+
|
|
218
|
+
| Feature | Teams | Discord | Slack |
|
|
219
|
+
|---------|-------|---------|-------|
|
|
220
|
+
| Server terminology | Team | Guild | Workspace |
|
|
221
|
+
| Channel identifiers | UUID format (19:xxx@thread.tacv2) | Snowflake IDs | Channel name or ID |
|
|
222
|
+
| Token storage | Cookies SQLite | LevelDB | LevelDB |
|
|
223
|
+
| Token expiry | **60-90 minutes** | Rarely expires | Rarely expires |
|
|
224
|
+
| Mentions | `<at id="user-id">Name</at>` | `<@user_id>` | `<@USER_ID>` |
|
|
225
|
+
|
|
226
|
+
**Important**: Teams uses UUID-style channel IDs (like `19:abc123@thread.tacv2`). You cannot use channel names directly - use `channel list` to find IDs first.
|
|
227
|
+
|
|
228
|
+
## Common Patterns
|
|
229
|
+
|
|
230
|
+
See `references/common-patterns.md` for typical AI agent workflows.
|
|
231
|
+
|
|
232
|
+
## Templates
|
|
233
|
+
|
|
234
|
+
See `templates/` directory for runnable examples:
|
|
235
|
+
- `post-message.sh` - Send messages with error handling
|
|
236
|
+
- `monitor-channel.sh` - Monitor channel for new messages (with token refresh)
|
|
237
|
+
- `team-summary.sh` - Generate team summary
|
|
238
|
+
|
|
239
|
+
## Error Handling
|
|
240
|
+
|
|
241
|
+
All commands return consistent error format:
|
|
242
|
+
|
|
243
|
+
```json
|
|
244
|
+
{
|
|
245
|
+
"error": "Not authenticated. Run \"auth extract\" first."
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Common errors:
|
|
250
|
+
- `Not authenticated`: No valid token - run `auth extract`
|
|
251
|
+
- `Token expired`: Token has expired (60-90 min limit) - run `auth extract` again
|
|
252
|
+
- `No current team set`: Run `team switch <id>` first
|
|
253
|
+
- `Message not found`: Invalid message ID
|
|
254
|
+
- `Channel not found`: Invalid channel ID
|
|
255
|
+
- `401 Unauthorized`: Token expired - re-authenticate immediately
|
|
256
|
+
|
|
257
|
+
## Configuration
|
|
258
|
+
|
|
259
|
+
Credentials stored in: `~/.config/agent-messenger/teams-credentials.json`
|
|
260
|
+
|
|
261
|
+
Format:
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"token": "skypetoken_asm_value_here",
|
|
265
|
+
"token_extracted_at": "2024-01-15T10:00:00.000Z",
|
|
266
|
+
"current_team": "team-uuid-here",
|
|
267
|
+
"teams": {
|
|
268
|
+
"team-uuid-here": {
|
|
269
|
+
"team_id": "team-uuid-here",
|
|
270
|
+
"team_name": "My Team"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Security**: File permissions set to 0600 (owner read/write only)
|
|
277
|
+
|
|
278
|
+
## Limitations
|
|
279
|
+
|
|
280
|
+
- No real-time events / WebSocket connection
|
|
281
|
+
- No voice/video channel support
|
|
282
|
+
- No team management (create/delete channels, roles)
|
|
283
|
+
- No meeting support
|
|
284
|
+
- No webhook support
|
|
285
|
+
- Plain text messages only (no adaptive cards in v1)
|
|
286
|
+
- User tokens only (no app tokens)
|
|
287
|
+
- **Token expires in 60-90 minutes** - must re-authenticate frequently
|
|
288
|
+
|
|
289
|
+
## References
|
|
290
|
+
|
|
291
|
+
- [Authentication Guide](references/authentication.md)
|
|
292
|
+
- [Common Patterns](references/common-patterns.md)
|