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,185 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, mock, test } from 'bun:test'
|
|
2
|
+
import { SlackClient } from '../../src/platforms/slack/client'
|
|
3
|
+
import type { SlackChannel } from '../../src/platforms/slack/types'
|
|
4
|
+
|
|
5
|
+
describe('Channel Commands', () => {
|
|
6
|
+
let mockClient: SlackClient
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
// Mock SlackClient
|
|
10
|
+
mockClient = {
|
|
11
|
+
listChannels: mock(async () => [
|
|
12
|
+
{
|
|
13
|
+
id: 'C001',
|
|
14
|
+
name: 'general',
|
|
15
|
+
is_private: false,
|
|
16
|
+
is_archived: false,
|
|
17
|
+
created: 1234567890,
|
|
18
|
+
creator: 'U001',
|
|
19
|
+
topic: {
|
|
20
|
+
value: 'General discussion',
|
|
21
|
+
creator: 'U001',
|
|
22
|
+
last_set: 1234567890,
|
|
23
|
+
},
|
|
24
|
+
purpose: {
|
|
25
|
+
value: 'General channel',
|
|
26
|
+
creator: 'U001',
|
|
27
|
+
last_set: 1234567890,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'C002',
|
|
32
|
+
name: 'private-team',
|
|
33
|
+
is_private: true,
|
|
34
|
+
is_archived: false,
|
|
35
|
+
created: 1234567891,
|
|
36
|
+
creator: 'U002',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 'C003',
|
|
40
|
+
name: 'archived-channel',
|
|
41
|
+
is_private: false,
|
|
42
|
+
is_archived: true,
|
|
43
|
+
created: 1234567892,
|
|
44
|
+
creator: 'U003',
|
|
45
|
+
},
|
|
46
|
+
]),
|
|
47
|
+
getChannel: mock(async (id: string) => {
|
|
48
|
+
const channels: Record<string, SlackChannel> = {
|
|
49
|
+
C001: {
|
|
50
|
+
id: 'C001',
|
|
51
|
+
name: 'general',
|
|
52
|
+
is_private: false,
|
|
53
|
+
is_archived: false,
|
|
54
|
+
created: 1234567890,
|
|
55
|
+
creator: 'U001',
|
|
56
|
+
topic: {
|
|
57
|
+
value: 'General discussion',
|
|
58
|
+
creator: 'U001',
|
|
59
|
+
last_set: 1234567890,
|
|
60
|
+
},
|
|
61
|
+
purpose: {
|
|
62
|
+
value: 'General channel',
|
|
63
|
+
creator: 'U001',
|
|
64
|
+
last_set: 1234567890,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
C002: {
|
|
68
|
+
id: 'C002',
|
|
69
|
+
name: 'private-team',
|
|
70
|
+
is_private: true,
|
|
71
|
+
is_archived: false,
|
|
72
|
+
created: 1234567891,
|
|
73
|
+
creator: 'U002',
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
if (!channels[id]) {
|
|
77
|
+
throw new Error(`Channel not found: ${id}`)
|
|
78
|
+
}
|
|
79
|
+
return channels[id]
|
|
80
|
+
}),
|
|
81
|
+
} as any
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
describe('channel list', () => {
|
|
85
|
+
test('lists all channels', async () => {
|
|
86
|
+
// Given: SlackClient returns channels
|
|
87
|
+
// When: Listing channels
|
|
88
|
+
const channels = await mockClient.listChannels()
|
|
89
|
+
|
|
90
|
+
// Then: Should return channels
|
|
91
|
+
expect(channels).toHaveLength(3)
|
|
92
|
+
expect(channels[0].name).toBe('general')
|
|
93
|
+
expect(channels[1].name).toBe('private-team')
|
|
94
|
+
expect(channels[2].name).toBe('archived-channel')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
test('excludes archived channels by default', async () => {
|
|
98
|
+
// Given: SlackClient returns channels including archived
|
|
99
|
+
const channels = await mockClient.listChannels()
|
|
100
|
+
|
|
101
|
+
// When: Filtering out archived (default behavior)
|
|
102
|
+
const activeChannels = channels.filter((c) => !c.is_archived)
|
|
103
|
+
|
|
104
|
+
// Then: Should exclude archived channels
|
|
105
|
+
expect(activeChannels).toHaveLength(2)
|
|
106
|
+
expect(activeChannels.every((c) => !c.is_archived)).toBe(true)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
test('includes archived channels when requested', async () => {
|
|
110
|
+
// Given: SlackClient returns channels including archived
|
|
111
|
+
const channels = await mockClient.listChannels()
|
|
112
|
+
|
|
113
|
+
// When: Including archived (--include-archived)
|
|
114
|
+
// Then: Should include all channels
|
|
115
|
+
expect(channels).toHaveLength(3)
|
|
116
|
+
expect(channels.some((c) => c.is_archived)).toBe(true)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
test('filters channels by type=public', async () => {
|
|
120
|
+
// Given: SlackClient returns mixed channels
|
|
121
|
+
// When: Filtering by public type
|
|
122
|
+
const channels = await mockClient.listChannels()
|
|
123
|
+
const publicChannels = channels.filter((c) => !c.is_private)
|
|
124
|
+
|
|
125
|
+
// Then: Should return only public channels
|
|
126
|
+
expect(publicChannels).toHaveLength(2)
|
|
127
|
+
expect(publicChannels.every((c) => !c.is_private)).toBe(true)
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
test('filters channels by type=private', async () => {
|
|
131
|
+
// Given: SlackClient returns mixed channels
|
|
132
|
+
// When: Filtering by private type
|
|
133
|
+
const channels = await mockClient.listChannels()
|
|
134
|
+
const privateChannels = channels.filter((c) => c.is_private)
|
|
135
|
+
|
|
136
|
+
// Then: Should return only private channels
|
|
137
|
+
expect(privateChannels).toHaveLength(1)
|
|
138
|
+
expect(privateChannels[0].name).toBe('private-team')
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
describe('channel info', () => {
|
|
143
|
+
test('gets channel by ID', async () => {
|
|
144
|
+
// Given: Channel ID C001
|
|
145
|
+
// When: Getting channel info
|
|
146
|
+
const channel = await mockClient.getChannel('C001')
|
|
147
|
+
|
|
148
|
+
// Then: Should return channel details
|
|
149
|
+
expect(channel.id).toBe('C001')
|
|
150
|
+
expect(channel.name).toBe('general')
|
|
151
|
+
expect(channel.is_private).toBe(false)
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
test('throws error for non-existent channel', async () => {
|
|
155
|
+
// Given: Non-existent channel ID
|
|
156
|
+
// When: Getting channel info
|
|
157
|
+
// Then: Should throw error
|
|
158
|
+
try {
|
|
159
|
+
await mockClient.getChannel('C999')
|
|
160
|
+
expect.unreachable()
|
|
161
|
+
} catch (error: any) {
|
|
162
|
+
expect(error.message).toContain('Channel not found')
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
test('returns channel with topic and purpose', async () => {
|
|
167
|
+
// Given: Channel with topic and purpose
|
|
168
|
+
// When: Getting channel info
|
|
169
|
+
const channel = await mockClient.getChannel('C001')
|
|
170
|
+
|
|
171
|
+
// Then: Should include topic and purpose
|
|
172
|
+
expect(channel.topic?.value).toBe('General discussion')
|
|
173
|
+
expect(channel.purpose?.value).toBe('General channel')
|
|
174
|
+
})
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
describe('channel history (alias for message list)', () => {
|
|
178
|
+
test('history command should be alias for message list', () => {
|
|
179
|
+
// Given: channel history command
|
|
180
|
+
// When: Checking command structure
|
|
181
|
+
// Then: Should be alias for message list
|
|
182
|
+
expect(true).toBe(true)
|
|
183
|
+
})
|
|
184
|
+
})
|
|
185
|
+
})
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, mock, test } from 'bun:test'
|
|
2
|
+
import { SlackClient } from '../../src/platforms/slack/client'
|
|
3
|
+
import type { SlackFile } from '../../src/platforms/slack/types'
|
|
4
|
+
|
|
5
|
+
describe('File Commands', () => {
|
|
6
|
+
let mockClient: SlackClient
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
mockClient = {
|
|
10
|
+
uploadFile: mock(async (channels: string[], file: Buffer, filename: string) => ({
|
|
11
|
+
id: 'F123',
|
|
12
|
+
name: filename,
|
|
13
|
+
title: filename,
|
|
14
|
+
mimetype: 'text/plain',
|
|
15
|
+
size: file.length,
|
|
16
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
17
|
+
created: Math.floor(Date.now() / 1000),
|
|
18
|
+
user: 'U123',
|
|
19
|
+
channels,
|
|
20
|
+
})),
|
|
21
|
+
listFiles: mock(async (channel?: string) => [
|
|
22
|
+
{
|
|
23
|
+
id: 'F123',
|
|
24
|
+
name: 'test.txt',
|
|
25
|
+
title: 'test.txt',
|
|
26
|
+
mimetype: 'text/plain',
|
|
27
|
+
size: 1024,
|
|
28
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
29
|
+
created: 1234567890,
|
|
30
|
+
user: 'U123',
|
|
31
|
+
channels: channel ? [channel] : ['C123'],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'F456',
|
|
35
|
+
name: 'document.pdf',
|
|
36
|
+
title: 'document.pdf',
|
|
37
|
+
mimetype: 'application/pdf',
|
|
38
|
+
size: 2048,
|
|
39
|
+
url_private: 'https://files.slack.com/files-pri/T123-F456/document.pdf',
|
|
40
|
+
created: 1234567891,
|
|
41
|
+
user: 'U456',
|
|
42
|
+
channels: channel ? [channel] : ['C456'],
|
|
43
|
+
},
|
|
44
|
+
]),
|
|
45
|
+
} as any
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('file upload', () => {
|
|
49
|
+
test('uploads file to channel', async () => {
|
|
50
|
+
const channel = 'C123'
|
|
51
|
+
const fileBuffer = Buffer.from('test content')
|
|
52
|
+
const filename = 'test.txt'
|
|
53
|
+
|
|
54
|
+
const result = await mockClient.uploadFile([channel], fileBuffer, filename)
|
|
55
|
+
|
|
56
|
+
expect(result.id).toBeDefined()
|
|
57
|
+
expect(result.name).toBe(filename)
|
|
58
|
+
expect(result.size).toBe(fileBuffer.length)
|
|
59
|
+
expect(result.channels).toContain(channel)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
test('supports --filename override', async () => {
|
|
63
|
+
const channel = 'C123'
|
|
64
|
+
const fileBuffer = Buffer.from('content')
|
|
65
|
+
const customFilename = 'custom-name.txt'
|
|
66
|
+
|
|
67
|
+
const result = await mockClient.uploadFile([channel], fileBuffer, customFilename)
|
|
68
|
+
|
|
69
|
+
expect(result.name).toBe(customFilename)
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
test('returns file with metadata', () => {
|
|
73
|
+
const file: SlackFile = {
|
|
74
|
+
id: 'F123',
|
|
75
|
+
name: 'test.txt',
|
|
76
|
+
title: 'test.txt',
|
|
77
|
+
mimetype: 'text/plain',
|
|
78
|
+
size: 1024,
|
|
79
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
80
|
+
created: 1234567890,
|
|
81
|
+
user: 'U123',
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const output = { ...file }
|
|
85
|
+
|
|
86
|
+
expect(output.id).toBe('F123')
|
|
87
|
+
expect(output.name).toBe('test.txt')
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
describe('file list', () => {
|
|
92
|
+
test('lists all files in workspace', async () => {
|
|
93
|
+
const files = await mockClient.listFiles()
|
|
94
|
+
|
|
95
|
+
expect(files).toHaveLength(2)
|
|
96
|
+
expect(files[0].name).toBe('test.txt')
|
|
97
|
+
expect(files[1].name).toBe('document.pdf')
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
test('filters files by channel', async () => {
|
|
101
|
+
const channel = 'C123'
|
|
102
|
+
|
|
103
|
+
const files = await mockClient.listFiles(channel)
|
|
104
|
+
|
|
105
|
+
expect(files).toBeDefined()
|
|
106
|
+
expect(files.length).toBeGreaterThan(0)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
test('returns files with metadata', () => {
|
|
110
|
+
const files: SlackFile[] = [
|
|
111
|
+
{
|
|
112
|
+
id: 'F123',
|
|
113
|
+
name: 'test.txt',
|
|
114
|
+
title: 'test.txt',
|
|
115
|
+
mimetype: 'text/plain',
|
|
116
|
+
size: 1024,
|
|
117
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
118
|
+
created: 1234567890,
|
|
119
|
+
user: 'U123',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'F456',
|
|
123
|
+
name: 'document.pdf',
|
|
124
|
+
title: 'document.pdf',
|
|
125
|
+
mimetype: 'application/pdf',
|
|
126
|
+
size: 2048,
|
|
127
|
+
url_private: 'https://files.slack.com/files-pri/T123-F456/document.pdf',
|
|
128
|
+
created: 1234567891,
|
|
129
|
+
user: 'U456',
|
|
130
|
+
},
|
|
131
|
+
]
|
|
132
|
+
|
|
133
|
+
const output = files.map((file) => ({ ...file }))
|
|
134
|
+
|
|
135
|
+
expect(output).toHaveLength(2)
|
|
136
|
+
expect(output[0].name).toBe('test.txt')
|
|
137
|
+
expect(output[1].name).toBe('document.pdf')
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
describe('file info', () => {
|
|
142
|
+
test('shows file details', async () => {
|
|
143
|
+
const fileId = 'F123'
|
|
144
|
+
|
|
145
|
+
const files = await mockClient.listFiles()
|
|
146
|
+
const file = files.find((f) => f.id === fileId)
|
|
147
|
+
|
|
148
|
+
expect(file).toBeDefined()
|
|
149
|
+
expect(file?.id).toBe(fileId)
|
|
150
|
+
expect(file?.name).toBe('test.txt')
|
|
151
|
+
})
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
describe('output formatting', () => {
|
|
155
|
+
test('includes file fields in output', () => {
|
|
156
|
+
const file: SlackFile = {
|
|
157
|
+
id: 'F123',
|
|
158
|
+
name: 'test.txt',
|
|
159
|
+
title: 'test.txt',
|
|
160
|
+
mimetype: 'text/plain',
|
|
161
|
+
size: 1024,
|
|
162
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
163
|
+
created: 1234567890,
|
|
164
|
+
user: 'U123',
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const output = { ...file }
|
|
168
|
+
|
|
169
|
+
expect(output.id).toBeDefined()
|
|
170
|
+
expect(output.name).toBe('test.txt')
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
test('formats multiple files', () => {
|
|
174
|
+
const files: SlackFile[] = [
|
|
175
|
+
{
|
|
176
|
+
id: 'F123',
|
|
177
|
+
name: 'test.txt',
|
|
178
|
+
title: 'test.txt',
|
|
179
|
+
mimetype: 'text/plain',
|
|
180
|
+
size: 1024,
|
|
181
|
+
url_private: 'https://files.slack.com/files-pri/T123-F123/test.txt',
|
|
182
|
+
created: 1234567890,
|
|
183
|
+
user: 'U123',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: 'F456',
|
|
187
|
+
name: 'document.pdf',
|
|
188
|
+
title: 'document.pdf',
|
|
189
|
+
mimetype: 'application/pdf',
|
|
190
|
+
size: 2048,
|
|
191
|
+
url_private: 'https://files.slack.com/files-pri/T123-F456/document.pdf',
|
|
192
|
+
created: 1234567891,
|
|
193
|
+
user: 'U456',
|
|
194
|
+
},
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
const output = files.map((file) => ({ ...file }))
|
|
198
|
+
|
|
199
|
+
expect(output).toHaveLength(2)
|
|
200
|
+
expect(output[0].name).toBe('test.txt')
|
|
201
|
+
expect(output[1].name).toBe('document.pdf')
|
|
202
|
+
})
|
|
203
|
+
})
|
|
204
|
+
})
|