agent-messenger 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/release.md +92 -0
- package/.claude-plugin/README.md +144 -0
- package/.claude-plugin/marketplace.json +37 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.github/workflows/ci.yml +30 -0
- package/CLAUDE.md +106 -0
- package/CONTRIBUTING.md +131 -0
- package/README.md +140 -0
- package/biome.json +34 -0
- package/bun.lock +252 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +21 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +140 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/channel.d.ts +3 -0
- package/dist/commands/channel.d.ts.map +1 -0
- package/dist/commands/channel.js +118 -0
- package/dist/commands/channel.js.map +1 -0
- package/dist/commands/file.d.ts +3 -0
- package/dist/commands/file.d.ts.map +1 -0
- package/dist/commands/file.js +113 -0
- package/dist/commands/file.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/message.d.ts +3 -0
- package/dist/commands/message.d.ts.map +1 -0
- package/dist/commands/message.js +214 -0
- package/dist/commands/message.js.map +1 -0
- package/dist/commands/reaction.d.ts +3 -0
- package/dist/commands/reaction.d.ts.map +1 -0
- package/dist/commands/reaction.js +100 -0
- package/dist/commands/reaction.js.map +1 -0
- package/dist/commands/snapshot.d.ts +3 -0
- package/dist/commands/snapshot.d.ts.map +1 -0
- package/dist/commands/snapshot.js +88 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/user.d.ts +3 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +96 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +89 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/lib/credential-manager.d.ts +13 -0
- package/dist/lib/credential-manager.d.ts.map +1 -0
- package/dist/lib/credential-manager.js +58 -0
- package/dist/lib/credential-manager.js.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +3 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/ref-manager.d.ts +26 -0
- package/dist/lib/ref-manager.d.ts.map +1 -0
- package/dist/lib/ref-manager.js +92 -0
- package/dist/lib/ref-manager.js.map +1 -0
- package/dist/lib/slack-client.d.ts +37 -0
- package/dist/lib/slack-client.d.ts.map +1 -0
- package/dist/lib/slack-client.js +379 -0
- package/dist/lib/slack-client.js.map +1 -0
- package/dist/lib/token-extractor.d.ts +28 -0
- package/dist/lib/token-extractor.d.ts.map +1 -0
- package/dist/lib/token-extractor.js +401 -0
- package/dist/lib/token-extractor.js.map +1 -0
- package/dist/package.json +37 -0
- package/dist/src/cli.d.ts +5 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +22 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/platforms/discord/cli.d.ts +5 -0
- package/dist/src/platforms/discord/cli.d.ts.map +1 -0
- package/dist/src/platforms/discord/cli.js +22 -0
- package/dist/src/platforms/discord/cli.js.map +1 -0
- package/dist/src/platforms/discord/client.d.ts +34 -0
- package/dist/src/platforms/discord/client.d.ts.map +1 -0
- package/dist/src/platforms/discord/client.js +187 -0
- package/dist/src/platforms/discord/client.js.map +1 -0
- package/dist/src/platforms/discord/client.test.d.ts +2 -0
- package/dist/src/platforms/discord/client.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/client.test.js +367 -0
- package/dist/src/platforms/discord/client.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/auth.d.ts +13 -0
- package/dist/src/platforms/discord/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/auth.js +155 -0
- package/dist/src/platforms/discord/commands/auth.js.map +1 -0
- package/dist/src/platforms/discord/commands/auth.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/auth.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/auth.test.js +65 -0
- package/dist/src/platforms/discord/commands/auth.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/channel.d.ts +13 -0
- package/dist/src/platforms/discord/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/channel.js +99 -0
- package/dist/src/platforms/discord/commands/channel.js.map +1 -0
- package/dist/src/platforms/discord/commands/channel.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/channel.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/channel.test.js +136 -0
- package/dist/src/platforms/discord/commands/channel.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/file.d.ts +13 -0
- package/dist/src/platforms/discord/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/file.js +99 -0
- package/dist/src/platforms/discord/commands/file.js.map +1 -0
- package/dist/src/platforms/discord/commands/file.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/file.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/file.test.js +83 -0
- package/dist/src/platforms/discord/commands/file.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/guild.d.ts +15 -0
- package/dist/src/platforms/discord/commands/guild.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/guild.js +102 -0
- package/dist/src/platforms/discord/commands/guild.js.map +1 -0
- package/dist/src/platforms/discord/commands/guild.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/guild.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/guild.test.js +100 -0
- package/dist/src/platforms/discord/commands/guild.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/index.d.ts +9 -0
- package/dist/src/platforms/discord/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/index.js +9 -0
- package/dist/src/platforms/discord/commands/index.js.map +1 -0
- package/dist/src/platforms/discord/commands/message.d.ts +17 -0
- package/dist/src/platforms/discord/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/message.js +131 -0
- package/dist/src/platforms/discord/commands/message.js.map +1 -0
- package/dist/src/platforms/discord/commands/message.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/message.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/message.test.js +91 -0
- package/dist/src/platforms/discord/commands/message.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.d.ts +12 -0
- package/dist/src/platforms/discord/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.js +99 -0
- package/dist/src/platforms/discord/commands/reaction.js.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/reaction.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/reaction.test.js +115 -0
- package/dist/src/platforms/discord/commands/reaction.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts +9 -0
- package/dist/src/platforms/discord/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.js +80 -0
- package/dist/src/platforms/discord/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/snapshot.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/snapshot.test.js +25 -0
- package/dist/src/platforms/discord/commands/snapshot.test.js.map +1 -0
- package/dist/src/platforms/discord/commands/user.d.ts +3 -0
- package/dist/src/platforms/discord/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/user.js +94 -0
- package/dist/src/platforms/discord/commands/user.js.map +1 -0
- package/dist/src/platforms/discord/commands/user.test.d.ts +2 -0
- package/dist/src/platforms/discord/commands/user.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/commands/user.test.js +103 -0
- package/dist/src/platforms/discord/commands/user.test.js.map +1 -0
- package/dist/src/platforms/discord/credential-manager.d.ts +33 -0
- package/dist/src/platforms/discord/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/discord/credential-manager.js +73 -0
- package/dist/src/platforms/discord/credential-manager.js.map +1 -0
- package/dist/src/platforms/discord/credential-manager.test.d.ts +2 -0
- package/dist/src/platforms/discord/credential-manager.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/credential-manager.test.js +136 -0
- package/dist/src/platforms/discord/credential-manager.test.js.map +1 -0
- package/dist/src/platforms/discord/token-extractor.d.ts +55 -0
- package/dist/src/platforms/discord/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/discord/token-extractor.js +462 -0
- package/dist/src/platforms/discord/token-extractor.js.map +1 -0
- package/dist/src/platforms/discord/token-extractor.test.d.ts +2 -0
- package/dist/src/platforms/discord/token-extractor.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/token-extractor.test.js +789 -0
- package/dist/src/platforms/discord/token-extractor.test.js.map +1 -0
- package/dist/src/platforms/discord/types.d.ts +251 -0
- package/dist/src/platforms/discord/types.d.ts.map +1 -0
- package/dist/src/platforms/discord/types.js +74 -0
- package/dist/src/platforms/discord/types.js.map +1 -0
- package/dist/src/platforms/discord/types.test.d.ts +2 -0
- package/dist/src/platforms/discord/types.test.d.ts.map +1 -0
- package/dist/src/platforms/discord/types.test.js +211 -0
- package/dist/src/platforms/discord/types.test.js.map +1 -0
- package/dist/src/platforms/slack/cli.d.ts +5 -0
- package/dist/src/platforms/slack/cli.d.ts.map +1 -0
- package/dist/src/platforms/slack/cli.js +22 -0
- package/dist/src/platforms/slack/cli.js.map +1 -0
- package/dist/src/platforms/slack/client.d.ts +47 -0
- package/dist/src/platforms/slack/client.d.ts.map +1 -0
- package/dist/src/platforms/slack/client.js +412 -0
- package/dist/src/platforms/slack/client.js.map +1 -0
- package/dist/src/platforms/slack/commands/auth.d.ts +3 -0
- package/dist/src/platforms/slack/commands/auth.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/auth.js +156 -0
- package/dist/src/platforms/slack/commands/auth.js.map +1 -0
- package/dist/src/platforms/slack/commands/channel.d.ts +3 -0
- package/dist/src/platforms/slack/commands/channel.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/channel.js +118 -0
- package/dist/src/platforms/slack/commands/channel.js.map +1 -0
- package/dist/src/platforms/slack/commands/file.d.ts +3 -0
- package/dist/src/platforms/slack/commands/file.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/file.js +113 -0
- package/dist/src/platforms/slack/commands/file.js.map +1 -0
- package/dist/src/platforms/slack/commands/index.d.ts +9 -0
- package/dist/src/platforms/slack/commands/index.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/index.js +9 -0
- package/dist/src/platforms/slack/commands/index.js.map +1 -0
- package/dist/src/platforms/slack/commands/message.d.ts +3 -0
- package/dist/src/platforms/slack/commands/message.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/message.js +263 -0
- package/dist/src/platforms/slack/commands/message.js.map +1 -0
- package/dist/src/platforms/slack/commands/reaction.d.ts +3 -0
- package/dist/src/platforms/slack/commands/reaction.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/reaction.js +100 -0
- package/dist/src/platforms/slack/commands/reaction.js.map +1 -0
- package/dist/src/platforms/slack/commands/snapshot.d.ts +3 -0
- package/dist/src/platforms/slack/commands/snapshot.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/snapshot.js +87 -0
- package/dist/src/platforms/slack/commands/snapshot.js.map +1 -0
- package/dist/src/platforms/slack/commands/user.d.ts +3 -0
- package/dist/src/platforms/slack/commands/user.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/user.js +96 -0
- package/dist/src/platforms/slack/commands/user.js.map +1 -0
- package/dist/src/platforms/slack/commands/workspace.d.ts +3 -0
- package/dist/src/platforms/slack/commands/workspace.d.ts.map +1 -0
- package/dist/src/platforms/slack/commands/workspace.js +89 -0
- package/dist/src/platforms/slack/commands/workspace.js.map +1 -0
- package/dist/src/platforms/slack/credential-manager.d.ts +13 -0
- package/dist/src/platforms/slack/credential-manager.d.ts.map +1 -0
- package/dist/src/platforms/slack/credential-manager.js +58 -0
- package/dist/src/platforms/slack/credential-manager.js.map +1 -0
- package/dist/src/platforms/slack/index.d.ts +3 -0
- package/dist/src/platforms/slack/index.d.ts.map +1 -0
- package/dist/src/platforms/slack/index.js +3 -0
- package/dist/src/platforms/slack/index.js.map +1 -0
- package/dist/src/platforms/slack/token-extractor.d.ts +28 -0
- package/dist/src/platforms/slack/token-extractor.d.ts.map +1 -0
- package/dist/src/platforms/slack/token-extractor.js +401 -0
- package/dist/src/platforms/slack/token-extractor.js.map +1 -0
- package/dist/src/platforms/slack/types.d.ts +369 -0
- package/dist/src/platforms/slack/types.d.ts.map +1 -0
- package/dist/src/platforms/slack/types.js +92 -0
- package/dist/src/platforms/slack/types.js.map +1 -0
- package/dist/src/shared/utils/concurrency.d.ts +2 -0
- package/dist/src/shared/utils/concurrency.d.ts.map +1 -0
- package/dist/src/shared/utils/concurrency.js +14 -0
- package/dist/src/shared/utils/concurrency.js.map +1 -0
- package/dist/src/shared/utils/concurrency.test.d.ts +2 -0
- package/dist/src/shared/utils/concurrency.test.d.ts.map +1 -0
- package/dist/src/shared/utils/concurrency.test.js +39 -0
- package/dist/src/shared/utils/concurrency.test.js.map +1 -0
- package/dist/src/shared/utils/error-handler.d.ts +2 -0
- package/dist/src/shared/utils/error-handler.d.ts.map +1 -0
- package/dist/src/shared/utils/error-handler.js +5 -0
- package/dist/src/shared/utils/error-handler.js.map +1 -0
- package/dist/src/shared/utils/output.d.ts +2 -0
- package/dist/src/shared/utils/output.d.ts.map +1 -0
- package/dist/src/shared/utils/output.js +4 -0
- package/dist/src/shared/utils/output.js.map +1 -0
- package/dist/tests/cli.test.d.ts +2 -0
- package/dist/tests/cli.test.d.ts.map +1 -0
- package/dist/tests/cli.test.js +83 -0
- package/dist/tests/cli.test.js.map +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/CURRENT +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOCK +0 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG +3 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/LOG.old +1 -0
- package/dist/tests/commands/.test-slack-data/Local Storage/leveldb/MANIFEST-000004 +0 -0
- package/dist/tests/commands/auth.test.d.ts +2 -0
- package/dist/tests/commands/auth.test.d.ts.map +1 -0
- package/dist/tests/commands/auth.test.js +304 -0
- package/dist/tests/commands/auth.test.js.map +1 -0
- package/dist/tests/commands/channel.test.d.ts +2 -0
- package/dist/tests/commands/channel.test.d.ts.map +1 -0
- package/dist/tests/commands/channel.test.js +166 -0
- package/dist/tests/commands/channel.test.js.map +1 -0
- package/dist/tests/commands/file.test.d.ts +2 -0
- package/dist/tests/commands/file.test.d.ts.map +1 -0
- package/dist/tests/commands/file.test.js +175 -0
- package/dist/tests/commands/file.test.js.map +1 -0
- package/dist/tests/commands/message.test.d.ts +2 -0
- package/dist/tests/commands/message.test.d.ts.map +1 -0
- package/dist/tests/commands/message.test.js +293 -0
- package/dist/tests/commands/message.test.js.map +1 -0
- package/dist/tests/commands/reaction.test.d.ts +2 -0
- package/dist/tests/commands/reaction.test.d.ts.map +1 -0
- package/dist/tests/commands/reaction.test.js +84 -0
- package/dist/tests/commands/reaction.test.js.map +1 -0
- package/dist/tests/commands/snapshot.test.d.ts +2 -0
- package/dist/tests/commands/snapshot.test.d.ts.map +1 -0
- package/dist/tests/commands/snapshot.test.js +280 -0
- package/dist/tests/commands/snapshot.test.js.map +1 -0
- package/dist/tests/commands/user.test.d.ts +2 -0
- package/dist/tests/commands/user.test.d.ts.map +1 -0
- package/dist/tests/commands/user.test.js +117 -0
- package/dist/tests/commands/user.test.js.map +1 -0
- package/dist/tests/commands/workspace.test.d.ts +2 -0
- package/dist/tests/commands/workspace.test.d.ts.map +1 -0
- package/dist/tests/commands/workspace.test.js +453 -0
- package/dist/tests/commands/workspace.test.js.map +1 -0
- package/dist/tests/credential-manager.test.d.ts +2 -0
- package/dist/tests/credential-manager.test.d.ts.map +1 -0
- package/dist/tests/credential-manager.test.js +199 -0
- package/dist/tests/credential-manager.test.js.map +1 -0
- package/dist/tests/slack-client.test.d.ts +2 -0
- package/dist/tests/slack-client.test.d.ts.map +1 -0
- package/dist/tests/slack-client.test.js +741 -0
- package/dist/tests/slack-client.test.js.map +1 -0
- package/dist/tests/types.test.d.ts +2 -0
- package/dist/tests/types.test.d.ts.map +1 -0
- package/dist/tests/types.test.js +215 -0
- package/dist/tests/types.test.js.map +1 -0
- package/dist/types/index.d.ts +369 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +92 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/error-handler.d.ts +2 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +5 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/output.d.ts +2 -0
- package/dist/utils/output.d.ts.map +1 -0
- package/dist/utils/output.js +4 -0
- package/dist/utils/output.js.map +1 -0
- package/docs/discord.md +182 -0
- package/docs/slack.md +160 -0
- package/package.json +37 -0
- package/skills/agent-discord/SKILL.md +273 -0
- package/skills/agent-discord/references/authentication.md +294 -0
- package/skills/agent-discord/references/common-patterns.md +455 -0
- package/skills/agent-discord/templates/guild-summary.sh +167 -0
- package/skills/agent-discord/templates/monitor-channel.sh +180 -0
- package/skills/agent-discord/templates/post-message.sh +173 -0
- package/skills/agent-slack/SKILL.md +268 -0
- package/skills/agent-slack/references/authentication.md +332 -0
- package/skills/agent-slack/references/common-patterns.md +527 -0
- package/skills/agent-slack/templates/monitor-channel.sh +186 -0
- package/skills/agent-slack/templates/post-message.sh +130 -0
- package/skills/agent-slack/templates/workspace-summary.sh +149 -0
- package/src/cli.ts +29 -0
- package/src/platforms/discord/cli.ts +36 -0
- package/src/platforms/discord/client.test.ts +456 -0
- package/src/platforms/discord/client.ts +281 -0
- package/src/platforms/discord/commands/auth.test.ts +72 -0
- package/src/platforms/discord/commands/auth.ts +206 -0
- package/src/platforms/discord/commands/channel.test.ts +153 -0
- package/src/platforms/discord/commands/channel.ts +127 -0
- package/src/platforms/discord/commands/file.test.ts +98 -0
- package/src/platforms/discord/commands/file.ts +134 -0
- package/src/platforms/discord/commands/guild.test.ts +117 -0
- package/src/platforms/discord/commands/guild.ts +129 -0
- package/src/platforms/discord/commands/index.ts +8 -0
- package/src/platforms/discord/commands/message.test.ts +107 -0
- package/src/platforms/discord/commands/message.ts +182 -0
- package/src/platforms/discord/commands/reaction.test.ts +123 -0
- package/src/platforms/discord/commands/reaction.ts +156 -0
- package/src/platforms/discord/commands/snapshot.test.ts +29 -0
- package/src/platforms/discord/commands/snapshot.ts +104 -0
- package/src/platforms/discord/commands/user.test.ts +115 -0
- package/src/platforms/discord/commands/user.ts +124 -0
- package/src/platforms/discord/credential-manager.test.ts +173 -0
- package/src/platforms/discord/credential-manager.ts +95 -0
- package/src/platforms/discord/token-extractor.test.ts +918 -0
- package/src/platforms/discord/token-extractor.ts +549 -0
- package/src/platforms/discord/types.test.ts +245 -0
- package/src/platforms/discord/types.ts +158 -0
- package/src/platforms/slack/cli.ts +36 -0
- package/src/platforms/slack/client.ts +466 -0
- package/src/platforms/slack/commands/auth.ts +211 -0
- package/src/platforms/slack/commands/channel.ts +158 -0
- package/src/platforms/slack/commands/file.ts +153 -0
- package/src/platforms/slack/commands/index.ts +8 -0
- package/src/platforms/slack/commands/message.ts +369 -0
- package/src/platforms/slack/commands/reaction.ts +166 -0
- package/src/platforms/slack/commands/snapshot.ts +114 -0
- package/src/platforms/slack/commands/user.ts +110 -0
- package/src/platforms/slack/commands/workspace.ts +111 -0
- package/src/platforms/slack/credential-manager.ts +74 -0
- package/src/platforms/slack/index.ts +2 -0
- package/src/platforms/slack/token-extractor.ts +496 -0
- package/src/platforms/slack/types.ts +193 -0
- package/src/shared/utils/concurrency.test.ts +53 -0
- package/src/shared/utils/concurrency.ts +20 -0
- package/src/shared/utils/error-handler.ts +4 -0
- package/src/shared/utils/output.ts +3 -0
- package/tests/cli.test.ts +94 -0
- package/tests/commands/auth.test.ts +383 -0
- package/tests/commands/channel.test.ts +185 -0
- package/tests/commands/file.test.ts +204 -0
- package/tests/commands/message.test.ts +344 -0
- package/tests/commands/reaction.test.ts +101 -0
- package/tests/commands/snapshot.test.ts +308 -0
- package/tests/commands/user.test.ts +138 -0
- package/tests/commands/workspace.test.ts +528 -0
- package/tests/credential-manager.test.ts +241 -0
- package/tests/slack-client.test.ts +916 -0
- package/tests/types.test.ts +241 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, mock, test } from 'bun:test'
|
|
2
|
+
import { SlackClient } from '../../src/platforms/slack/client'
|
|
3
|
+
import type { SlackMessage } from '../../src/platforms/slack/types'
|
|
4
|
+
|
|
5
|
+
describe('Message Commands', () => {
|
|
6
|
+
let mockClient: SlackClient
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
// Mock SlackClient
|
|
10
|
+
mockClient = {
|
|
11
|
+
sendMessage: mock(async (_channel: string, text: string, threadTs?: string) => ({
|
|
12
|
+
ts: '1234567890.123456',
|
|
13
|
+
text,
|
|
14
|
+
type: 'message',
|
|
15
|
+
user: 'U123',
|
|
16
|
+
thread_ts: threadTs,
|
|
17
|
+
})),
|
|
18
|
+
getMessages: mock(async (_channel: string, _limit?: number) => [
|
|
19
|
+
{
|
|
20
|
+
ts: '1234567890.123456',
|
|
21
|
+
text: 'First message',
|
|
22
|
+
type: 'message',
|
|
23
|
+
user: 'U123',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
ts: '1234567890.123457',
|
|
27
|
+
text: 'Second message',
|
|
28
|
+
type: 'message',
|
|
29
|
+
user: 'U456',
|
|
30
|
+
},
|
|
31
|
+
]),
|
|
32
|
+
updateMessage: mock(async (_channel: string, ts: string, text: string) => ({
|
|
33
|
+
ts,
|
|
34
|
+
text,
|
|
35
|
+
type: 'message',
|
|
36
|
+
user: 'U123',
|
|
37
|
+
})),
|
|
38
|
+
deleteMessage: mock(async (_channel: string, _ts: string) => {
|
|
39
|
+
// no-op
|
|
40
|
+
}),
|
|
41
|
+
getMessage: mock(async (_channel: string, ts: string) => {
|
|
42
|
+
if (ts === '1234567890.123456') {
|
|
43
|
+
return {
|
|
44
|
+
ts: '1234567890.123456',
|
|
45
|
+
text: 'Found single message',
|
|
46
|
+
type: 'message',
|
|
47
|
+
user: 'U123',
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return null
|
|
51
|
+
}),
|
|
52
|
+
searchMessages: mock(async (_query: string, _options?: any) => [
|
|
53
|
+
{
|
|
54
|
+
ts: '1234567890.123456',
|
|
55
|
+
text: 'Found message 1',
|
|
56
|
+
user: 'U123',
|
|
57
|
+
channel: { id: 'C001', name: 'general' },
|
|
58
|
+
permalink: 'https://workspace.slack.com/archives/C001/p1234567890123456',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
ts: '1234567890.123457',
|
|
62
|
+
text: 'Found message 2',
|
|
63
|
+
user: 'U456',
|
|
64
|
+
channel: { id: 'C002', name: 'random' },
|
|
65
|
+
permalink: 'https://workspace.slack.com/archives/C002/p1234567890123457',
|
|
66
|
+
},
|
|
67
|
+
]),
|
|
68
|
+
getThreadReplies: mock(async (_channel: string, _threadTs: string, _options?: any) => ({
|
|
69
|
+
messages: [
|
|
70
|
+
{
|
|
71
|
+
ts: '1234567890.123456',
|
|
72
|
+
text: 'Parent message',
|
|
73
|
+
type: 'message',
|
|
74
|
+
user: 'U123',
|
|
75
|
+
thread_ts: '1234567890.123456',
|
|
76
|
+
reply_count: 2,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
ts: '1234567890.123457',
|
|
80
|
+
text: 'First reply',
|
|
81
|
+
type: 'message',
|
|
82
|
+
user: 'U456',
|
|
83
|
+
thread_ts: '1234567890.123456',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
ts: '1234567890.123458',
|
|
87
|
+
text: 'Second reply',
|
|
88
|
+
type: 'message',
|
|
89
|
+
user: 'U789',
|
|
90
|
+
thread_ts: '1234567890.123456',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
has_more: false,
|
|
94
|
+
})),
|
|
95
|
+
} as any
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
describe('message send', () => {
|
|
99
|
+
test('sends message to channel', async () => {
|
|
100
|
+
// Given: A channel and message text
|
|
101
|
+
const channel = 'C123'
|
|
102
|
+
const text = 'Hello, world!'
|
|
103
|
+
|
|
104
|
+
// When: Sending message
|
|
105
|
+
const result = await mockClient.sendMessage(channel, text)
|
|
106
|
+
|
|
107
|
+
// Then: Should return message with ts
|
|
108
|
+
expect(result.ts).toBeDefined()
|
|
109
|
+
expect(result.text).toBe(text)
|
|
110
|
+
expect(result.type).toBe('message')
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
test('sends message to thread', async () => {
|
|
114
|
+
// Given: A channel, message text, and thread ts
|
|
115
|
+
const channel = 'C123'
|
|
116
|
+
const text = 'Reply in thread'
|
|
117
|
+
const threadTs = '1234567890.123456'
|
|
118
|
+
|
|
119
|
+
// When: Sending message with thread_ts
|
|
120
|
+
const result = await mockClient.sendMessage(channel, text, threadTs)
|
|
121
|
+
|
|
122
|
+
// Then: Should include thread_ts
|
|
123
|
+
expect(result.thread_ts).toBe(threadTs)
|
|
124
|
+
expect(result.text).toBe(text)
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
describe('message list', () => {
|
|
129
|
+
test('lists messages from channel', async () => {
|
|
130
|
+
// Given: A channel
|
|
131
|
+
const channel = 'C123'
|
|
132
|
+
|
|
133
|
+
// When: Getting messages
|
|
134
|
+
const messages = await mockClient.getMessages(channel)
|
|
135
|
+
|
|
136
|
+
// Then: Should return array of messages
|
|
137
|
+
expect(messages).toHaveLength(2)
|
|
138
|
+
expect(messages[0].text).toBe('First message')
|
|
139
|
+
expect(messages[1].text).toBe('Second message')
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
test('respects limit parameter', async () => {
|
|
143
|
+
// Given: A channel and limit
|
|
144
|
+
const channel = 'C123'
|
|
145
|
+
const limit = 10
|
|
146
|
+
|
|
147
|
+
// When: Getting messages with limit
|
|
148
|
+
const messages = await mockClient.getMessages(channel, limit)
|
|
149
|
+
|
|
150
|
+
// Then: Should pass limit to API
|
|
151
|
+
expect(messages).toBeDefined()
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
test('filters messages by thread', async () => {
|
|
155
|
+
// Given: A channel and thread ts
|
|
156
|
+
const channel = 'C123'
|
|
157
|
+
const _threadTs = '1234567890.123456'
|
|
158
|
+
|
|
159
|
+
// When: Getting thread messages
|
|
160
|
+
const messages = await mockClient.getMessages(channel)
|
|
161
|
+
|
|
162
|
+
// Then: Should return messages
|
|
163
|
+
expect(messages).toBeDefined()
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
describe('message update', () => {
|
|
168
|
+
test('updates message text', async () => {
|
|
169
|
+
// Given: A channel, message ts, and new text
|
|
170
|
+
const channel = 'C123'
|
|
171
|
+
const ts = '1234567890.123456'
|
|
172
|
+
const newText = 'Updated message'
|
|
173
|
+
|
|
174
|
+
// When: Updating message
|
|
175
|
+
const result = await mockClient.updateMessage(channel, ts, newText)
|
|
176
|
+
|
|
177
|
+
// Then: Should return updated message
|
|
178
|
+
expect(result.ts).toBe(ts)
|
|
179
|
+
expect(result.text).toBe(newText)
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
|
|
183
|
+
describe('message delete', () => {
|
|
184
|
+
test('deletes message', async () => {
|
|
185
|
+
// Given: A channel and message ts
|
|
186
|
+
const channel = 'C123'
|
|
187
|
+
const ts = '1234567890.123456'
|
|
188
|
+
|
|
189
|
+
// When: Deleting message
|
|
190
|
+
await mockClient.deleteMessage(channel, ts)
|
|
191
|
+
|
|
192
|
+
// Then: Should complete without error
|
|
193
|
+
expect(mockClient.deleteMessage).toHaveBeenCalled()
|
|
194
|
+
})
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
describe('message get', () => {
|
|
198
|
+
test('gets single message by timestamp', async () => {
|
|
199
|
+
// Given: A channel and message ts
|
|
200
|
+
const channel = 'C123'
|
|
201
|
+
const ts = '1234567890.123456'
|
|
202
|
+
|
|
203
|
+
// When: Getting message by ts
|
|
204
|
+
const message = await mockClient.getMessage(channel, ts)
|
|
205
|
+
|
|
206
|
+
// Then: Should return the message
|
|
207
|
+
expect(message).not.toBeNull()
|
|
208
|
+
expect(message?.ts).toBe(ts)
|
|
209
|
+
expect(message?.text).toBe('Found single message')
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
test('returns null for non-existent message', async () => {
|
|
213
|
+
// Given: A channel and non-existent ts
|
|
214
|
+
const channel = 'C123'
|
|
215
|
+
const ts = '9999999999.999999'
|
|
216
|
+
|
|
217
|
+
// When: Getting non-existent message
|
|
218
|
+
const message = await mockClient.getMessage(channel, ts)
|
|
219
|
+
|
|
220
|
+
// Then: Should return null
|
|
221
|
+
expect(message).toBeNull()
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
describe('message search', () => {
|
|
226
|
+
test('searches messages across workspace', async () => {
|
|
227
|
+
// Given: A search query
|
|
228
|
+
const query = 'hello world'
|
|
229
|
+
|
|
230
|
+
// When: Searching messages
|
|
231
|
+
const results = await mockClient.searchMessages(query)
|
|
232
|
+
|
|
233
|
+
// Then: Should return matching messages with channel info
|
|
234
|
+
expect(results).toHaveLength(2)
|
|
235
|
+
expect(results[0].text).toBe('Found message 1')
|
|
236
|
+
expect(results[0].channel.name).toBe('general')
|
|
237
|
+
expect(results[0].permalink).toBeDefined()
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
test('returns channel info with each result', async () => {
|
|
241
|
+
// Given: A search query
|
|
242
|
+
const query = 'test'
|
|
243
|
+
|
|
244
|
+
// When: Searching messages
|
|
245
|
+
const results = await mockClient.searchMessages(query)
|
|
246
|
+
|
|
247
|
+
// Then: Each result should have channel info
|
|
248
|
+
for (const result of results) {
|
|
249
|
+
expect(result.channel).toBeDefined()
|
|
250
|
+
expect(result.channel.id).toBeDefined()
|
|
251
|
+
expect(result.channel.name).toBeDefined()
|
|
252
|
+
}
|
|
253
|
+
})
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
describe('message replies', () => {
|
|
257
|
+
test('gets thread replies including parent message', async () => {
|
|
258
|
+
// Given: A channel and thread ts
|
|
259
|
+
const channel = 'C123'
|
|
260
|
+
const threadTs = '1234567890.123456'
|
|
261
|
+
|
|
262
|
+
// When: Getting thread replies
|
|
263
|
+
const result = await mockClient.getThreadReplies(channel, threadTs)
|
|
264
|
+
|
|
265
|
+
// Then: Should return parent and replies
|
|
266
|
+
expect(result.messages).toHaveLength(3)
|
|
267
|
+
expect(result.messages[0].text).toBe('Parent message')
|
|
268
|
+
expect(result.messages[0].reply_count).toBe(2)
|
|
269
|
+
expect(result.messages[1].text).toBe('First reply')
|
|
270
|
+
expect(result.messages[2].text).toBe('Second reply')
|
|
271
|
+
})
|
|
272
|
+
|
|
273
|
+
test('returns has_more flag for pagination', async () => {
|
|
274
|
+
// Given: A channel and thread ts
|
|
275
|
+
const channel = 'C123'
|
|
276
|
+
const threadTs = '1234567890.123456'
|
|
277
|
+
|
|
278
|
+
// When: Getting thread replies
|
|
279
|
+
const result = await mockClient.getThreadReplies(channel, threadTs)
|
|
280
|
+
|
|
281
|
+
// Then: Should include pagination info
|
|
282
|
+
expect(result.has_more).toBe(false)
|
|
283
|
+
})
|
|
284
|
+
|
|
285
|
+
test('all replies have same thread_ts as parent', async () => {
|
|
286
|
+
// Given: A channel and thread ts
|
|
287
|
+
const channel = 'C123'
|
|
288
|
+
const threadTs = '1234567890.123456'
|
|
289
|
+
|
|
290
|
+
// When: Getting thread replies
|
|
291
|
+
const result = await mockClient.getThreadReplies(channel, threadTs)
|
|
292
|
+
|
|
293
|
+
// Then: All messages should have the same thread_ts
|
|
294
|
+
for (const msg of result.messages) {
|
|
295
|
+
expect(msg.thread_ts).toBe(threadTs)
|
|
296
|
+
}
|
|
297
|
+
})
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
describe('output formatting', () => {
|
|
301
|
+
test('formats message output', () => {
|
|
302
|
+
// Given: A message
|
|
303
|
+
const message: SlackMessage = {
|
|
304
|
+
ts: '1234567890.123456',
|
|
305
|
+
text: 'Hello',
|
|
306
|
+
type: 'message',
|
|
307
|
+
user: 'U123',
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// When: Formatting output
|
|
311
|
+
const output = { ...message }
|
|
312
|
+
|
|
313
|
+
// Then: Should include message fields
|
|
314
|
+
expect(output.ts).toBeDefined()
|
|
315
|
+
expect(output.text).toBe('Hello')
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
test('formats multiple messages', () => {
|
|
319
|
+
// Given: Multiple messages
|
|
320
|
+
const messages: SlackMessage[] = [
|
|
321
|
+
{
|
|
322
|
+
ts: '1234567890.123456',
|
|
323
|
+
text: 'First',
|
|
324
|
+
type: 'message',
|
|
325
|
+
user: 'U123',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
ts: '1234567890.123457',
|
|
329
|
+
text: 'Second',
|
|
330
|
+
type: 'message',
|
|
331
|
+
user: 'U456',
|
|
332
|
+
},
|
|
333
|
+
]
|
|
334
|
+
|
|
335
|
+
// When: Formatting
|
|
336
|
+
const output = messages.map((msg) => ({ ...msg }))
|
|
337
|
+
|
|
338
|
+
// Then: Should have all messages
|
|
339
|
+
expect(output).toHaveLength(2)
|
|
340
|
+
expect(output[0].text).toBe('First')
|
|
341
|
+
expect(output[1].text).toBe('Second')
|
|
342
|
+
})
|
|
343
|
+
})
|
|
344
|
+
})
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, expect, mock, test } from 'bun:test'
|
|
2
|
+
import { Command } from 'commander'
|
|
3
|
+
import { reactionCommand } from '../../src/platforms/slack/commands/reaction'
|
|
4
|
+
|
|
5
|
+
describe('reaction command', () => {
|
|
6
|
+
describe('add subcommand', () => {
|
|
7
|
+
test('adds reaction to message with channel and message ts', async () => {
|
|
8
|
+
const channelId = 'C123'
|
|
9
|
+
const messageTs = '1234567890.123456'
|
|
10
|
+
const emoji = 'thumbsup'
|
|
11
|
+
|
|
12
|
+
const mockAddReaction = mock((..._args: any[]) => Promise.resolve())
|
|
13
|
+
await mockAddReaction(channelId, messageTs, emoji)
|
|
14
|
+
|
|
15
|
+
expect(mockAddReaction).toHaveBeenCalledWith(channelId, messageTs, emoji)
|
|
16
|
+
expect(mockAddReaction).toHaveBeenCalledTimes(1)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
test('handles emoji without colons', async () => {
|
|
20
|
+
const channelId = 'C123'
|
|
21
|
+
const messageTs = '1234567890.123456'
|
|
22
|
+
const emoji = 'thumbsup'
|
|
23
|
+
|
|
24
|
+
const mockAddReaction = mock((..._args: any[]) => Promise.resolve())
|
|
25
|
+
await mockAddReaction(channelId, messageTs, emoji)
|
|
26
|
+
|
|
27
|
+
expect(mockAddReaction).toHaveBeenCalledWith(channelId, messageTs, 'thumbsup')
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
describe('remove subcommand', () => {
|
|
32
|
+
test('removes reaction from message with channel and message ts', async () => {
|
|
33
|
+
const channelId = 'C123'
|
|
34
|
+
const messageTs = '1234567890.123456'
|
|
35
|
+
const emoji = 'thumbsup'
|
|
36
|
+
|
|
37
|
+
const mockRemoveReaction = mock((..._args: any[]) => Promise.resolve())
|
|
38
|
+
await mockRemoveReaction(channelId, messageTs, emoji)
|
|
39
|
+
|
|
40
|
+
expect(mockRemoveReaction).toHaveBeenCalledWith(channelId, messageTs, emoji)
|
|
41
|
+
expect(mockRemoveReaction).toHaveBeenCalledTimes(1)
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
describe('list subcommand', () => {
|
|
46
|
+
test('lists reactions on a message', async () => {
|
|
47
|
+
const messageTs = '1234567890.123456'
|
|
48
|
+
const mockMessages = [
|
|
49
|
+
{
|
|
50
|
+
ts: messageTs,
|
|
51
|
+
text: 'Hello',
|
|
52
|
+
type: 'message',
|
|
53
|
+
user: 'U456',
|
|
54
|
+
reactions: [
|
|
55
|
+
{ name: 'thumbsup', count: 2, users: ['U123', 'U456'] },
|
|
56
|
+
{ name: 'heart', count: 1, users: ['U789'] },
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
const mockGetMessages = mock(() => Promise.resolve(mockMessages))
|
|
62
|
+
const result = await mockGetMessages()
|
|
63
|
+
|
|
64
|
+
expect(result).toHaveLength(1)
|
|
65
|
+
expect(result[0].ts).toBe(messageTs)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('returns empty reactions list when no reactions', async () => {
|
|
69
|
+
const messageTs = '1234567890.123456'
|
|
70
|
+
const mockMessages = [
|
|
71
|
+
{
|
|
72
|
+
ts: messageTs,
|
|
73
|
+
text: 'Hello',
|
|
74
|
+
type: 'message',
|
|
75
|
+
user: 'U456',
|
|
76
|
+
reactions: [],
|
|
77
|
+
},
|
|
78
|
+
]
|
|
79
|
+
|
|
80
|
+
const mockGetMessages = mock(() => Promise.resolve(mockMessages))
|
|
81
|
+
const result = await mockGetMessages()
|
|
82
|
+
|
|
83
|
+
expect(result).toHaveLength(1)
|
|
84
|
+
expect(result[0].reactions).toEqual([])
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
describe('command structure', () => {
|
|
89
|
+
test('reaction command exists', () => {
|
|
90
|
+
expect(reactionCommand).toBeInstanceOf(Command)
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
test('reaction command has correct name', () => {
|
|
94
|
+
expect(reactionCommand.name()).toBe('reaction')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
test('reaction command has description', () => {
|
|
98
|
+
expect(reactionCommand.description()).toBe('Reaction commands')
|
|
99
|
+
})
|
|
100
|
+
})
|
|
101
|
+
})
|