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
package/dist/commands/user.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { CredentialManager } from '../lib/credential-manager';
|
|
3
|
-
import { SlackClient } from '../lib/slack-client';
|
|
4
|
-
import { handleError } from '../utils/error-handler';
|
|
5
|
-
import { formatOutput } from '../utils/output';
|
|
6
|
-
async function getClient(pretty) {
|
|
7
|
-
const credManager = new CredentialManager();
|
|
8
|
-
const workspace = await credManager.getWorkspace();
|
|
9
|
-
if (!workspace) {
|
|
10
|
-
console.log(formatOutput({ error: 'No current workspace set. Run "auth extract" first.' }, pretty));
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
return new SlackClient(workspace.token, workspace.cookie);
|
|
14
|
-
}
|
|
15
|
-
export const userCommand = new Command('user')
|
|
16
|
-
.description('user commands')
|
|
17
|
-
.addCommand(new Command('list')
|
|
18
|
-
.description('list workspace users')
|
|
19
|
-
.option('--include-bots', 'include bot users')
|
|
20
|
-
.option('--pretty', 'pretty-print JSON output')
|
|
21
|
-
.action(async (options) => {
|
|
22
|
-
try {
|
|
23
|
-
const client = await getClient(options.pretty);
|
|
24
|
-
if (!client)
|
|
25
|
-
return process.exit(1);
|
|
26
|
-
const users = await client.listUsers();
|
|
27
|
-
const filtered = options.includeBots ? users : users.filter((u) => !u.is_bot);
|
|
28
|
-
const output = filtered.map((user) => ({
|
|
29
|
-
id: user.id,
|
|
30
|
-
name: user.name,
|
|
31
|
-
real_name: user.real_name,
|
|
32
|
-
is_admin: user.is_admin,
|
|
33
|
-
is_owner: user.is_owner,
|
|
34
|
-
is_bot: user.is_bot,
|
|
35
|
-
is_app_user: user.is_app_user,
|
|
36
|
-
profile: user.profile,
|
|
37
|
-
}));
|
|
38
|
-
console.log(formatOutput(output, options.pretty));
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
handleError(error);
|
|
42
|
-
}
|
|
43
|
-
}))
|
|
44
|
-
.addCommand(new Command('info')
|
|
45
|
-
.description('show user details')
|
|
46
|
-
.argument('<user>', 'user ID or username')
|
|
47
|
-
.option('--pretty', 'pretty-print JSON output')
|
|
48
|
-
.action(async (userArg, options) => {
|
|
49
|
-
try {
|
|
50
|
-
const client = await getClient(options.pretty);
|
|
51
|
-
if (!client)
|
|
52
|
-
return process.exit(1);
|
|
53
|
-
const user = await client.getUser(userArg);
|
|
54
|
-
const output = {
|
|
55
|
-
id: user.id,
|
|
56
|
-
name: user.name,
|
|
57
|
-
real_name: user.real_name,
|
|
58
|
-
is_admin: user.is_admin,
|
|
59
|
-
is_owner: user.is_owner,
|
|
60
|
-
is_bot: user.is_bot,
|
|
61
|
-
is_app_user: user.is_app_user,
|
|
62
|
-
profile: user.profile,
|
|
63
|
-
};
|
|
64
|
-
console.log(formatOutput(output, options.pretty));
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
handleError(error);
|
|
68
|
-
}
|
|
69
|
-
}))
|
|
70
|
-
.addCommand(new Command('me')
|
|
71
|
-
.description('show current authenticated user')
|
|
72
|
-
.option('--pretty', 'pretty-print JSON output')
|
|
73
|
-
.action(async (options) => {
|
|
74
|
-
try {
|
|
75
|
-
const client = await getClient(options.pretty);
|
|
76
|
-
if (!client)
|
|
77
|
-
return process.exit(1);
|
|
78
|
-
const authInfo = await client.testAuth();
|
|
79
|
-
const user = await client.getUser(authInfo.user_id);
|
|
80
|
-
const output = {
|
|
81
|
-
id: user.id,
|
|
82
|
-
name: user.name,
|
|
83
|
-
real_name: user.real_name,
|
|
84
|
-
is_admin: user.is_admin,
|
|
85
|
-
is_owner: user.is_owner,
|
|
86
|
-
is_bot: user.is_bot,
|
|
87
|
-
is_app_user: user.is_app_user,
|
|
88
|
-
profile: user.profile,
|
|
89
|
-
};
|
|
90
|
-
console.log(formatOutput(output, options.pretty));
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
handleError(error);
|
|
94
|
-
}
|
|
95
|
-
}));
|
|
96
|
-
//# sourceMappingURL=user.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/commands/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,KAAK,UAAU,SAAS,CAAC,MAA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AA;IAC7B,CAAC;AACH,CAAC,CAAC,CACL,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/commands/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAmFnC,eAAO,MAAM,gBAAgB,SA2B1B,CAAA"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { CredentialManager } from '../lib/credential-manager';
|
|
3
|
-
import { handleError } from '../utils/error-handler';
|
|
4
|
-
import { formatOutput } from '../utils/output';
|
|
5
|
-
async function listAction(options) {
|
|
6
|
-
try {
|
|
7
|
-
const credManager = new CredentialManager();
|
|
8
|
-
const config = await credManager.load();
|
|
9
|
-
const workspaces = Object.values(config.workspaces);
|
|
10
|
-
const output = workspaces.map((ws) => ({
|
|
11
|
-
id: ws.workspace_id,
|
|
12
|
-
name: ws.workspace_name,
|
|
13
|
-
current: ws.workspace_id === config.current_workspace,
|
|
14
|
-
}));
|
|
15
|
-
console.log(formatOutput(output, options.pretty));
|
|
16
|
-
}
|
|
17
|
-
catch (error) {
|
|
18
|
-
handleError(error);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
async function switchAction(id, options) {
|
|
22
|
-
try {
|
|
23
|
-
const credManager = new CredentialManager();
|
|
24
|
-
const config = await credManager.load();
|
|
25
|
-
if (!config.workspaces[id]) {
|
|
26
|
-
console.log(formatOutput({ error: `Workspace not found: ${id}` }, options.pretty));
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
await credManager.setCurrentWorkspace(id);
|
|
30
|
-
console.log(formatOutput({ current: id }, options.pretty));
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
handleError(error);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
async function currentAction(options) {
|
|
37
|
-
try {
|
|
38
|
-
const credManager = new CredentialManager();
|
|
39
|
-
const workspace = await credManager.getWorkspace();
|
|
40
|
-
if (!workspace) {
|
|
41
|
-
console.log(formatOutput({ error: 'No current workspace set. Run "auth extract" first.' }, options.pretty));
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
const output = {
|
|
45
|
-
workspace_id: workspace.workspace_id,
|
|
46
|
-
workspace_name: workspace.workspace_name,
|
|
47
|
-
};
|
|
48
|
-
console.log(formatOutput(output, options.pretty));
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
handleError(error);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async function removeAction(id, options) {
|
|
55
|
-
try {
|
|
56
|
-
const credManager = new CredentialManager();
|
|
57
|
-
const config = await credManager.load();
|
|
58
|
-
if (!config.workspaces[id]) {
|
|
59
|
-
console.log(formatOutput({ error: `Workspace not found: ${id}` }, options.pretty));
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
await credManager.removeWorkspace(id);
|
|
63
|
-
console.log(formatOutput({ removed: id }, options.pretty));
|
|
64
|
-
}
|
|
65
|
-
catch (error) {
|
|
66
|
-
handleError(error);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
export const workspaceCommand = new Command('workspace')
|
|
70
|
-
.description('Workspace management commands')
|
|
71
|
-
.addCommand(new Command('list')
|
|
72
|
-
.description('List all workspaces')
|
|
73
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
74
|
-
.action(listAction))
|
|
75
|
-
.addCommand(new Command('switch')
|
|
76
|
-
.description('Switch to workspace')
|
|
77
|
-
.argument('<id>', 'Workspace ID')
|
|
78
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
79
|
-
.action(switchAction))
|
|
80
|
-
.addCommand(new Command('current')
|
|
81
|
-
.description('Show current workspace')
|
|
82
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
83
|
-
.action(currentAction))
|
|
84
|
-
.addCommand(new Command('remove')
|
|
85
|
-
.description('Remove workspace')
|
|
86
|
-
.argument('<id>', 'Workspace ID')
|
|
87
|
-
.option('--pretty', 'Pretty print JSON output')
|
|
88
|
-
.action(removeAction));
|
|
89
|
-
//# sourceMappingURL=workspace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/commands/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,KAAK,UAAU,UAAU,CAAC,OAA6B;IACrD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAA;QAC3C,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,CAAA;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QAEnD,MAAM,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YACrC,EAAE,EAAE,EAAE,CAAC,YAAY;YACnB,IAAI,EAAE,EAAE,CAAC,cAAc;YACvB,OAAO,EAAE,EAAE,CAAC,YAAY,KAAK,MAAM,CAAC,iBAAiB;SACtD,CAAC,CAAC,CAAA;QAEH,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;IACnD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,WAAW,CAAC,KAAc,CAAC,CAAA;IAC7B,CAAC;AACH,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,EAAU,EAAE,OAA6B;IACnE,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,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AC,SAAS,CAAC;KACnB,WAAW,CAAC,wBAAwB,CAAC;KACrC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,aAAa,CAAC,CACzB;KACA,UAAU,CACT,IAAI,OAAO,CAAC,QAAQ,CAAC;KAClB,WAAW,CAAC,kBAAkB,CAAC;KAC/B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC;KAChC,MAAM,CAAC,UAAU,EAAE,0BAA0B,CAAC;KAC9C,MAAM,CAAC,YAAY,CAAC,CACxB,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Config, WorkspaceCredentials } from '../types';
|
|
2
|
-
export declare class CredentialManager {
|
|
3
|
-
private configDir;
|
|
4
|
-
private credentialsPath;
|
|
5
|
-
constructor(configDir?: string);
|
|
6
|
-
load(): Promise<Config>;
|
|
7
|
-
save(config: Config): Promise<void>;
|
|
8
|
-
getWorkspace(id?: string): Promise<WorkspaceCredentials | null>;
|
|
9
|
-
setWorkspace(creds: WorkspaceCredentials): Promise<void>;
|
|
10
|
-
removeWorkspace(id: string): Promise<void>;
|
|
11
|
-
setCurrentWorkspace(id: string): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=credential-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.d.ts","sourceRoot":"","sources":["../../src/lib/credential-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE5D,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,eAAe,CAAQ;gBAEnB,SAAS,CAAC,EAAE,MAAM;IAKxB,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAavB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASnC,YAAY,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAc/D,YAAY,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAMxD,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAW1C,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKrD"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { mkdir } from 'node:fs/promises';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
export class CredentialManager {
|
|
6
|
-
configDir;
|
|
7
|
-
credentialsPath;
|
|
8
|
-
constructor(configDir) {
|
|
9
|
-
this.configDir = configDir ?? join(homedir(), '.config', 'agent-slack');
|
|
10
|
-
this.credentialsPath = join(this.configDir, 'credentials.json');
|
|
11
|
-
}
|
|
12
|
-
async load() {
|
|
13
|
-
if (!existsSync(this.credentialsPath)) {
|
|
14
|
-
return {
|
|
15
|
-
current_workspace: null,
|
|
16
|
-
workspaces: {},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const file = Bun.file(this.credentialsPath);
|
|
20
|
-
const content = await file.text();
|
|
21
|
-
return JSON.parse(content);
|
|
22
|
-
}
|
|
23
|
-
async save(config) {
|
|
24
|
-
await mkdir(this.configDir, { recursive: true });
|
|
25
|
-
const file = Bun.file(this.credentialsPath);
|
|
26
|
-
await Bun.write(file, JSON.stringify(config, null, 2));
|
|
27
|
-
await Bun.spawn(['chmod', '0600', this.credentialsPath]).exited;
|
|
28
|
-
}
|
|
29
|
-
async getWorkspace(id) {
|
|
30
|
-
const config = await this.load();
|
|
31
|
-
if (id) {
|
|
32
|
-
return config.workspaces[id] ?? null;
|
|
33
|
-
}
|
|
34
|
-
if (!config.current_workspace) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return config.workspaces[config.current_workspace] ?? null;
|
|
38
|
-
}
|
|
39
|
-
async setWorkspace(creds) {
|
|
40
|
-
const config = await this.load();
|
|
41
|
-
config.workspaces[creds.workspace_id] = creds;
|
|
42
|
-
await this.save(config);
|
|
43
|
-
}
|
|
44
|
-
async removeWorkspace(id) {
|
|
45
|
-
const config = await this.load();
|
|
46
|
-
delete config.workspaces[id];
|
|
47
|
-
if (config.current_workspace === id) {
|
|
48
|
-
config.current_workspace = null;
|
|
49
|
-
}
|
|
50
|
-
await this.save(config);
|
|
51
|
-
}
|
|
52
|
-
async setCurrentWorkspace(id) {
|
|
53
|
-
const config = await this.load();
|
|
54
|
-
config.current_workspace = id;
|
|
55
|
-
await this.save(config);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=credential-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential-manager.js","sourceRoot":"","sources":["../../src/lib/credential-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,MAAM,OAAO,iBAAiB;IACpB,SAAS,CAAQ;IACjB,eAAe,CAAQ;IAE/B,YAAY,SAAkB;QAC5B,IAAI,CAAC,SAAS,GAAG,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,aAAa,CAAC,CAAA;QACvE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAA;IACjE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACtC,OAAO;gBACL,iBAAiB,EAAE,IA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AAY,CAAC,GAAG,KAAK,CAAA;QAC7C,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,EAAU;QAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QAChC,OAAO,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QAE5B,IAAI,MAAM,CAAC,iBAAiB,KAAK,EAAE,EAAE,CAAC;YACpC,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAA;QACjC,CAAC;QAED,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,EAAU;QAClC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;QAChC,MAAM,CAAC,iBAAiB,GAAG,EAAE,CAAA;QAC7B,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;CACF"}
|
package/dist/lib/index.d.ts
DELETED
package/dist/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/lib/index.js
DELETED
package/dist/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ChannelRef, FileRef, MessageRef, SlackChannel, SlackFile, SlackMessage, SlackUser, UserRef } from '../types';
|
|
2
|
-
export declare class RefManager {
|
|
3
|
-
private channelRefs;
|
|
4
|
-
private messageRefs;
|
|
5
|
-
private userRefs;
|
|
6
|
-
private fileRefs;
|
|
7
|
-
private channelCounter;
|
|
8
|
-
private messageCounter;
|
|
9
|
-
private userCounter;
|
|
10
|
-
private fileCounter;
|
|
11
|
-
assignChannelRef(channel: SlackChannel): ChannelRef;
|
|
12
|
-
assignMessageRef(message: SlackMessage): MessageRef;
|
|
13
|
-
assignUserRef(user: SlackUser): UserRef;
|
|
14
|
-
assignFileRef(file: SlackFile): FileRef;
|
|
15
|
-
resolveRef(ref: string): {
|
|
16
|
-
type: 'channel' | 'message' | 'user' | 'file';
|
|
17
|
-
id: string;
|
|
18
|
-
} | null;
|
|
19
|
-
getChannelByRef(ref: ChannelRef): SlackChannel | null;
|
|
20
|
-
getMessageByRef(ref: MessageRef): SlackMessage | null;
|
|
21
|
-
getUserByRef(ref: UserRef): SlackUser | null;
|
|
22
|
-
getFileByRef(ref: FileRef): SlackFile | null;
|
|
23
|
-
clear(): void;
|
|
24
|
-
serialize(): string;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=ref-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref-manager.d.ts","sourceRoot":"","sources":["../../src/lib/ref-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACR,MAAM,UAAU,CAAA;AAEjB,qBAAa,UAAU;IACrB,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,WAAW,CAAkC;IACrD,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,QAAQ,CAA+B;IAE/C,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,WAAW,CAAI;IAEvB,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU;IAOnD,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,UAAU;IAOnD,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAOvC,aAAa,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO;IAOvC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAoB7F,eAAe,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI;IAIrD,eAAe,CAAC,GAAG,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI;IAIrD,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAI5C,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI;IAI5C,KAAK,IAAI,IAAI;IAWb,SAAS,IAAI,MAAM;CAkBpB"}
|
package/dist/lib/ref-manager.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export class RefManager {
|
|
2
|
-
channelRefs = new Map();
|
|
3
|
-
messageRefs = new Map();
|
|
4
|
-
userRefs = new Map();
|
|
5
|
-
fileRefs = new Map();
|
|
6
|
-
channelCounter = 1;
|
|
7
|
-
messageCounter = 1;
|
|
8
|
-
userCounter = 1;
|
|
9
|
-
fileCounter = 1;
|
|
10
|
-
assignChannelRef(channel) {
|
|
11
|
-
const ref = `@c${this.channelCounter}`;
|
|
12
|
-
this.channelRefs.set(ref, channel);
|
|
13
|
-
this.channelCounter++;
|
|
14
|
-
return ref;
|
|
15
|
-
}
|
|
16
|
-
assignMessageRef(message) {
|
|
17
|
-
const ref = `@m${this.messageCounter}`;
|
|
18
|
-
this.messageRefs.set(ref, message);
|
|
19
|
-
this.messageCounter++;
|
|
20
|
-
return ref;
|
|
21
|
-
}
|
|
22
|
-
assignUserRef(user) {
|
|
23
|
-
const ref = `@u${this.userCounter}`;
|
|
24
|
-
this.userRefs.set(ref, user);
|
|
25
|
-
this.userCounter++;
|
|
26
|
-
return ref;
|
|
27
|
-
}
|
|
28
|
-
assignFileRef(file) {
|
|
29
|
-
const ref = `@f${this.fileCounter}`;
|
|
30
|
-
this.fileRefs.set(ref, file);
|
|
31
|
-
this.fileCounter++;
|
|
32
|
-
return ref;
|
|
33
|
-
}
|
|
34
|
-
resolveRef(ref) {
|
|
35
|
-
if (ref.startsWith('@c')) {
|
|
36
|
-
const channel = this.channelRefs.get(ref);
|
|
37
|
-
return channel ? { type: 'channel', id: channel.id } : null;
|
|
38
|
-
}
|
|
39
|
-
if (ref.startsWith('@m')) {
|
|
40
|
-
const message = this.messageRefs.get(ref);
|
|
41
|
-
return message ? { type: 'message', id: message.ts } : null;
|
|
42
|
-
}
|
|
43
|
-
if (ref.startsWith('@u')) {
|
|
44
|
-
const user = this.userRefs.get(ref);
|
|
45
|
-
return user ? { type: 'user', id: user.id } : null;
|
|
46
|
-
}
|
|
47
|
-
if (ref.startsWith('@f')) {
|
|
48
|
-
const file = this.fileRefs.get(ref);
|
|
49
|
-
return file ? { type: 'file', id: file.id } : null;
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
getChannelByRef(ref) {
|
|
54
|
-
return this.channelRefs.get(ref) || null;
|
|
55
|
-
}
|
|
56
|
-
getMessageByRef(ref) {
|
|
57
|
-
return this.messageRefs.get(ref) || null;
|
|
58
|
-
}
|
|
59
|
-
getUserByRef(ref) {
|
|
60
|
-
return this.userRefs.get(ref) || null;
|
|
61
|
-
}
|
|
62
|
-
getFileByRef(ref) {
|
|
63
|
-
return this.fileRefs.get(ref) || null;
|
|
64
|
-
}
|
|
65
|
-
clear() {
|
|
66
|
-
this.channelRefs.clear();
|
|
67
|
-
this.messageRefs.clear();
|
|
68
|
-
this.userRefs.clear();
|
|
69
|
-
this.fileRefs.clear();
|
|
70
|
-
this.channelCounter = 1;
|
|
71
|
-
this.messageCounter = 1;
|
|
72
|
-
this.userCounter = 1;
|
|
73
|
-
this.fileCounter = 1;
|
|
74
|
-
}
|
|
75
|
-
serialize() {
|
|
76
|
-
const refs = {};
|
|
77
|
-
for (const [ref, channel] of this.channelRefs) {
|
|
78
|
-
refs[ref] = channel.id;
|
|
79
|
-
}
|
|
80
|
-
for (const [ref, message] of this.messageRefs) {
|
|
81
|
-
refs[ref] = message.ts;
|
|
82
|
-
}
|
|
83
|
-
for (const [ref, user] of this.userRefs) {
|
|
84
|
-
refs[ref] = user.id;
|
|
85
|
-
}
|
|
86
|
-
for (const [ref, file] of this.fileRefs) {
|
|
87
|
-
refs[ref] = file.id;
|
|
88
|
-
}
|
|
89
|
-
return JSON.stringify(refs);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=ref-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ref-manager.js","sourceRoot":"","sources":["../../src/lib/ref-manager.ts"],"names":[],"mappings":"AAWA,MAAM,OAAO,UAAU;IACb,WAAW,GAAG,IAAI,GAAG,EAAwB,CAAA;IAC7C,WAAW,GAAG,IAAI,GAAG,EAAwB,CAAA;IAC7C,QAAQ,GAAG,IAAI,GAAG,EAAqB,CAAA;IACvC,QAAQ,GAAG,IAAI,GAAG,EAAqB,CAAA;IAEvC,cAAc,GAAG,CAAC,CAAA;IAClB,cAAc,GAAG,CAAC,CAAA;IAClB,WAAW,GAAG,CAAC,CAAA;IACf,WAAW,GAAG,CAAC,CAAA;IAEvB,gBAAgB,CAAC,OAAqB;QACpC,MAAM,GAAG,GAAG,KAAK,IAAI,CAAC,cAAc,EAAgB,CAAA;QACpD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAClC,IAAI,C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A;QACxB,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAA;QACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;QACrB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAA;QACrB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAA;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAA;IACtB,CAAC;IAED,SAAS;QACP,MAAM,IAAI,GAA2B,EAAE,CAAA;QAEvC,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,EAAE,CAAA;QACxB,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,EAAE,CAAA;QACxB,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;QACrB,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACxC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;QACrB,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;CACF"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { SlackChannel, SlackFile, SlackMessage, SlackSearchResult, SlackUser } from '../types';
|
|
2
|
-
export declare class SlackError extends Error {
|
|
3
|
-
code: string;
|
|
4
|
-
constructor(message: string, code: string);
|
|
5
|
-
}
|
|
6
|
-
export declare class SlackClient {
|
|
7
|
-
private client;
|
|
8
|
-
constructor(token: string, cookie: string);
|
|
9
|
-
private withRetry;
|
|
10
|
-
private sleep;
|
|
11
|
-
private checkResponse;
|
|
12
|
-
testAuth(): Promise<{
|
|
13
|
-
user_id: string;
|
|
14
|
-
team_id: string;
|
|
15
|
-
user?: string;
|
|
16
|
-
team?: string;
|
|
17
|
-
}>;
|
|
18
|
-
listChannels(): Promise<SlackChannel[]>;
|
|
19
|
-
getChannel(id: string): Promise<SlackChannel>;
|
|
20
|
-
sendMessage(channel: string, text: string, threadTs?: string): Promise<SlackMessage>;
|
|
21
|
-
getMessages(channel: string, limit?: number): Promise<SlackMessage[]>;
|
|
22
|
-
getMessage(channel: string, ts: string): Promise<SlackMessage | null>;
|
|
23
|
-
updateMessage(channel: string, ts: string, text: string): Promise<SlackMessage>;
|
|
24
|
-
deleteMessage(channel: string, ts: string): Promise<void>;
|
|
25
|
-
addReaction(channel: string, ts: string, emoji: string): Promise<void>;
|
|
26
|
-
removeReaction(channel: string, ts: string, emoji: string): Promise<void>;
|
|
27
|
-
listUsers(): Promise<SlackUser[]>;
|
|
28
|
-
getUser(id: string): Promise<SlackUser>;
|
|
29
|
-
uploadFile(channels: string[], file: Buffer, filename: string): Promise<SlackFile>;
|
|
30
|
-
listFiles(channel?: string): Promise<SlackFile[]>;
|
|
31
|
-
searchMessages(query: string, options?: {
|
|
32
|
-
sort?: 'score' | 'timestamp';
|
|
33
|
-
sortDir?: 'asc' | 'desc';
|
|
34
|
-
count?: number;
|
|
35
|
-
}): Promise<SlackSearchResult[]>;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=slack-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"slack-client.d.ts","sourceRoot":"","sources":["../../src/lib/slack-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,YA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