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,245 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test'
|
|
2
|
+
import {
|
|
3
|
+
DiscordChannelSchema,
|
|
4
|
+
DiscordConfigSchema,
|
|
5
|
+
DiscordCredentialsSchema,
|
|
6
|
+
DiscordError,
|
|
7
|
+
DiscordFileSchema,
|
|
8
|
+
DiscordGuildSchema,
|
|
9
|
+
DiscordMessageSchema,
|
|
10
|
+
DiscordReactionSchema,
|
|
11
|
+
DiscordUserSchema,
|
|
12
|
+
} from './types'
|
|
13
|
+
|
|
14
|
+
test('DiscordGuildSchema validates correct guild', () => {
|
|
15
|
+
const result = DiscordGuildSchema.safeParse({
|
|
16
|
+
id: '123456789012345678',
|
|
17
|
+
name: 'Test Guild',
|
|
18
|
+
})
|
|
19
|
+
expect(result.success).toBe(true)
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('DiscordGuildSchema rejects missing id', () => {
|
|
23
|
+
const result = DiscordGuildSchema.safeParse({
|
|
24
|
+
name: 'Test Guild',
|
|
25
|
+
})
|
|
26
|
+
expect(result.success).toBe(false)
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
test('DiscordGuildSchema rejects missing name', () => {
|
|
30
|
+
const result = DiscordGuildSchema.safeParse({
|
|
31
|
+
id: '123456789012345678',
|
|
32
|
+
})
|
|
33
|
+
expect(result.success).toBe(false)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
test('DiscordChannelSchema validates correct channel', () => {
|
|
37
|
+
const result = DiscordChannelSchema.safeParse({
|
|
38
|
+
id: '987654321098765432',
|
|
39
|
+
guild_id: '123456789012345678',
|
|
40
|
+
name: 'general',
|
|
41
|
+
type: 0,
|
|
42
|
+
})
|
|
43
|
+
expect(result.success).toBe(true)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
test('DiscordChannelSchema validates channel with optional fields', () => {
|
|
47
|
+
const result = DiscordChannelSchema.safeParse({
|
|
48
|
+
id: '987654321098765432',
|
|
49
|
+
guild_id: '123456789012345678',
|
|
50
|
+
name: 'general',
|
|
51
|
+
type: 0,
|
|
52
|
+
topic: 'Channel topic',
|
|
53
|
+
position: 0,
|
|
54
|
+
})
|
|
55
|
+
expect(result.success).toBe(true)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
test('DiscordChannelSchema rejects missing required fields', () => {
|
|
59
|
+
const result = DiscordChannelSchema.safeParse({
|
|
60
|
+
id: '987654321098765432',
|
|
61
|
+
name: 'general',
|
|
62
|
+
})
|
|
63
|
+
expect(result.success).toBe(false)
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
test('DiscordMessageSchema validates correct message', () => {
|
|
67
|
+
const result = DiscordMessageSchema.safeParse({
|
|
68
|
+
id: '111222333444555666',
|
|
69
|
+
channel_id: '987654321098765432',
|
|
70
|
+
author: {
|
|
71
|
+
id: '222333444555666777',
|
|
72
|
+
username: 'testuser',
|
|
73
|
+
},
|
|
74
|
+
content: 'Hello world',
|
|
75
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
76
|
+
})
|
|
77
|
+
expect(result.success).toBe(true)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
test('DiscordMessageSchema validates message with optional fields', () => {
|
|
81
|
+
const result = DiscordMessageSchema.safeParse({
|
|
82
|
+
id: '111222333444555666',
|
|
83
|
+
channel_id: '987654321098765432',
|
|
84
|
+
author: {
|
|
85
|
+
id: '222333444555666777',
|
|
86
|
+
username: 'testuser',
|
|
87
|
+
},
|
|
88
|
+
content: 'Hello world',
|
|
89
|
+
timestamp: '2024-01-01T00:00:00.000Z',
|
|
90
|
+
edited_timestamp: '2024-01-01T00:01:00.000Z',
|
|
91
|
+
thread_id: '333444555666777888',
|
|
92
|
+
})
|
|
93
|
+
expect(result.success).toBe(true)
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
test('DiscordMessageSchema rejects missing required fields', () => {
|
|
97
|
+
const result = DiscordMessageSchema.safeParse({
|
|
98
|
+
id: '111222333444555666',
|
|
99
|
+
channel_id: '987654321098765432',
|
|
100
|
+
content: 'Hello world',
|
|
101
|
+
})
|
|
102
|
+
expect(result.success).toBe(false)
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
test('DiscordUserSchema validates correct user', () => {
|
|
106
|
+
const result = DiscordUserSchema.safeParse({
|
|
107
|
+
id: '222333444555666777',
|
|
108
|
+
username: 'testuser',
|
|
109
|
+
})
|
|
110
|
+
expect(result.success).toBe(true)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
test('DiscordUserSchema validates user with optional fields', () => {
|
|
114
|
+
const result = DiscordUserSchema.safeParse({
|
|
115
|
+
id: '222333444555666777',
|
|
116
|
+
username: 'testuser',
|
|
117
|
+
global_name: 'Test User',
|
|
118
|
+
avatar: 'avatar_hash',
|
|
119
|
+
bot: false,
|
|
120
|
+
})
|
|
121
|
+
expect(result.success).toBe(true)
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
test('DiscordUserSchema rejects missing required fields', () => {
|
|
125
|
+
const result = DiscordUserSchema.safeParse({
|
|
126
|
+
id: '222333444555666777',
|
|
127
|
+
})
|
|
128
|
+
expect(result.success).toBe(false)
|
|
129
|
+
})
|
|
130
|
+
|
|
131
|
+
test('DiscordReactionSchema validates correct reaction', () => {
|
|
132
|
+
const result = DiscordReactionSchema.safeParse({
|
|
133
|
+
emoji: {
|
|
134
|
+
name: 'thumbsup',
|
|
135
|
+
},
|
|
136
|
+
count: 5,
|
|
137
|
+
})
|
|
138
|
+
expect(result.success).toBe(true)
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
test('DiscordReactionSchema validates reaction with custom emoji', () => {
|
|
142
|
+
const result = DiscordReactionSchema.safeParse({
|
|
143
|
+
emoji: {
|
|
144
|
+
id: '123456789012345678',
|
|
145
|
+
name: 'custom_emoji',
|
|
146
|
+
},
|
|
147
|
+
count: 3,
|
|
148
|
+
})
|
|
149
|
+
expect(result.success).toBe(true)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
test('DiscordReactionSchema rejects missing required fields', () => {
|
|
153
|
+
const result = DiscordReactionSchema.safeParse({
|
|
154
|
+
emoji: {
|
|
155
|
+
name: 'thumbsup',
|
|
156
|
+
},
|
|
157
|
+
})
|
|
158
|
+
expect(result.success).toBe(false)
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
test('DiscordFileSchema validates correct file', () => {
|
|
162
|
+
const result = DiscordFileSchema.safeParse({
|
|
163
|
+
id: '444555666777888999',
|
|
164
|
+
filename: 'document.pdf',
|
|
165
|
+
size: 1024,
|
|
166
|
+
url: 'https://cdn.discordapp.com/attachments/...',
|
|
167
|
+
})
|
|
168
|
+
expect(result.success).toBe(true)
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
test('DiscordFileSchema validates file with optional fields', () => {
|
|
172
|
+
const result = DiscordFileSchema.safeParse({
|
|
173
|
+
id: '444555666777888999',
|
|
174
|
+
filename: 'document.pdf',
|
|
175
|
+
size: 1024,
|
|
176
|
+
url: 'https://cdn.discordapp.com/attachments/...',
|
|
177
|
+
content_type: 'application/pdf',
|
|
178
|
+
height: 100,
|
|
179
|
+
width: 100,
|
|
180
|
+
})
|
|
181
|
+
expect(result.success).toBe(true)
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
test('DiscordFileSchema rejects missing required fields', () => {
|
|
185
|
+
const result = DiscordFileSchema.safeParse({
|
|
186
|
+
id: '444555666777888999',
|
|
187
|
+
filename: 'document.pdf',
|
|
188
|
+
})
|
|
189
|
+
expect(result.success).toBe(false)
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
test('DiscordCredentialsSchema validates correct credentials', () => {
|
|
193
|
+
const result = DiscordCredentialsSchema.safeParse({
|
|
194
|
+
token: 'token_value',
|
|
195
|
+
})
|
|
196
|
+
expect(result.success).toBe(true)
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
test('DiscordCredentialsSchema rejects missing token', () => {
|
|
200
|
+
const result = DiscordCredentialsSchema.safeParse({})
|
|
201
|
+
expect(result.success).toBe(false)
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
test('DiscordConfigSchema validates correct config', () => {
|
|
205
|
+
const result = DiscordConfigSchema.safeParse({
|
|
206
|
+
current_guild: null,
|
|
207
|
+
token: 'token_value',
|
|
208
|
+
guilds: {},
|
|
209
|
+
})
|
|
210
|
+
expect(result.success).toBe(true)
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
test('DiscordConfigSchema validates config with guilds', () => {
|
|
214
|
+
const result = DiscordConfigSchema.safeParse({
|
|
215
|
+
current_guild: '123456789012345678',
|
|
216
|
+
token: 'token_value',
|
|
217
|
+
guilds: {
|
|
218
|
+
'123456789012345678': {
|
|
219
|
+
guild_id: '123456789012345678',
|
|
220
|
+
guild_name: 'Test Guild',
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
})
|
|
224
|
+
expect(result.success).toBe(true)
|
|
225
|
+
})
|
|
226
|
+
|
|
227
|
+
test('DiscordConfigSchema rejects missing required fields', () => {
|
|
228
|
+
const result = DiscordConfigSchema.safeParse({
|
|
229
|
+
current_guild: null,
|
|
230
|
+
token: 'token_value',
|
|
231
|
+
})
|
|
232
|
+
expect(result.success).toBe(false)
|
|
233
|
+
})
|
|
234
|
+
|
|
235
|
+
test('DiscordError has correct name and code', () => {
|
|
236
|
+
const error = new DiscordError('Test error', 'TEST_CODE')
|
|
237
|
+
expect(error.name).toBe('DiscordError')
|
|
238
|
+
expect(error.message).toBe('Test error')
|
|
239
|
+
expect(error.code).toBe('TEST_CODE')
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
test('DiscordError is instance of Error', () => {
|
|
243
|
+
const error = new DiscordError('Test error', 'TEST_CODE')
|
|
244
|
+
expect(error instanceof Error).toBe(true)
|
|
245
|
+
})
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for Discord platform
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { z } from 'zod'
|
|
6
|
+
|
|
7
|
+
export interface DiscordGuild {
|
|
8
|
+
id: string
|
|
9
|
+
name: string
|
|
10
|
+
icon?: string
|
|
11
|
+
owner?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface DiscordChannel {
|
|
15
|
+
id: string
|
|
16
|
+
guild_id: string
|
|
17
|
+
name: string
|
|
18
|
+
type: number
|
|
19
|
+
topic?: string
|
|
20
|
+
position?: number
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DiscordMessage {
|
|
24
|
+
id: string
|
|
25
|
+
channel_id: string
|
|
26
|
+
author: {
|
|
27
|
+
id: string
|
|
28
|
+
username: string
|
|
29
|
+
}
|
|
30
|
+
content: string
|
|
31
|
+
timestamp: string
|
|
32
|
+
edited_timestamp?: string
|
|
33
|
+
thread_id?: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface DiscordUser {
|
|
37
|
+
id: string
|
|
38
|
+
username: string
|
|
39
|
+
global_name?: string
|
|
40
|
+
avatar?: string
|
|
41
|
+
bot?: boolean
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DiscordReaction {
|
|
45
|
+
emoji: {
|
|
46
|
+
id?: string
|
|
47
|
+
name: string
|
|
48
|
+
}
|
|
49
|
+
count: number
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface DiscordFile {
|
|
53
|
+
id: string
|
|
54
|
+
filename: string
|
|
55
|
+
size: number
|
|
56
|
+
url: string
|
|
57
|
+
content_type?: string
|
|
58
|
+
height?: number
|
|
59
|
+
width?: number
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface DiscordCredentials {
|
|
63
|
+
token: string
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface DiscordConfig {
|
|
67
|
+
current_guild: string | null
|
|
68
|
+
token: string
|
|
69
|
+
guilds: Record<
|
|
70
|
+
string,
|
|
71
|
+
{
|
|
72
|
+
guild_id: string
|
|
73
|
+
guild_name: string
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Zod validation schemas
|
|
79
|
+
export const DiscordGuildSchema = z.object({
|
|
80
|
+
id: z.string(),
|
|
81
|
+
name: z.string(),
|
|
82
|
+
icon: z.string().optional(),
|
|
83
|
+
owner: z.boolean().optional(),
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
export const DiscordChannelSchema = z.object({
|
|
87
|
+
id: z.string(),
|
|
88
|
+
guild_id: z.string(),
|
|
89
|
+
name: z.string(),
|
|
90
|
+
type: z.number(),
|
|
91
|
+
topic: z.string().optional(),
|
|
92
|
+
position: z.number().optional(),
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
export const DiscordMessageSchema = z.object({
|
|
96
|
+
id: z.string(),
|
|
97
|
+
channel_id: z.string(),
|
|
98
|
+
author: z.object({
|
|
99
|
+
id: z.string(),
|
|
100
|
+
username: z.string(),
|
|
101
|
+
}),
|
|
102
|
+
content: z.string(),
|
|
103
|
+
timestamp: z.string(),
|
|
104
|
+
edited_timestamp: z.string().optional(),
|
|
105
|
+
thread_id: z.string().optional(),
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
export const DiscordUserSchema = z.object({
|
|
109
|
+
id: z.string(),
|
|
110
|
+
username: z.string(),
|
|
111
|
+
global_name: z.string().optional(),
|
|
112
|
+
avatar: z.string().optional(),
|
|
113
|
+
bot: z.boolean().optional(),
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
export const DiscordReactionSchema = z.object({
|
|
117
|
+
emoji: z.object({
|
|
118
|
+
id: z.string().optional(),
|
|
119
|
+
name: z.string(),
|
|
120
|
+
}),
|
|
121
|
+
count: z.number(),
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
export const DiscordFileSchema = z.object({
|
|
125
|
+
id: z.string(),
|
|
126
|
+
filename: z.string(),
|
|
127
|
+
size: z.number(),
|
|
128
|
+
url: z.string(),
|
|
129
|
+
content_type: z.string().optional(),
|
|
130
|
+
height: z.number().optional(),
|
|
131
|
+
width: z.number().optional(),
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
export const DiscordCredentialsSchema = z.object({
|
|
135
|
+
token: z.string(),
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
export const DiscordConfigSchema = z.object({
|
|
139
|
+
current_guild: z.string().nullable(),
|
|
140
|
+
token: z.string(),
|
|
141
|
+
guilds: z.record(
|
|
142
|
+
z.string(),
|
|
143
|
+
z.object({
|
|
144
|
+
guild_id: z.string(),
|
|
145
|
+
guild_name: z.string(),
|
|
146
|
+
})
|
|
147
|
+
),
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
export class DiscordError extends Error {
|
|
151
|
+
code: string
|
|
152
|
+
|
|
153
|
+
constructor(message: string, code: string) {
|
|
154
|
+
super(message)
|
|
155
|
+
this.name = 'DiscordError'
|
|
156
|
+
this.code = code
|
|
157
|
+
}
|
|
158
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { Command } from 'commander'
|
|
4
|
+
import pkg from '../../../package.json'
|
|
5
|
+
import {
|
|
6
|
+
authCommand,
|
|
7
|
+
channelCommand,
|
|
8
|
+
fileCommand,
|
|
9
|
+
messageCommand,
|
|
10
|
+
reactionCommand,
|
|
11
|
+
snapshotCommand,
|
|
12
|
+
userCommand,
|
|
13
|
+
workspaceCommand,
|
|
14
|
+
} from './commands/index'
|
|
15
|
+
|
|
16
|
+
const program = new Command()
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name('agent-slack')
|
|
20
|
+
.description('CLI tool for Slack communication with token extraction from Slack desktop app')
|
|
21
|
+
.version(pkg.version)
|
|
22
|
+
.option('--pretty', 'Pretty-print JSON output')
|
|
23
|
+
.option('--workspace <id>', 'Use specific workspace')
|
|
24
|
+
|
|
25
|
+
program.addCommand(authCommand)
|
|
26
|
+
program.addCommand(workspaceCommand)
|
|
27
|
+
program.addCommand(messageCommand)
|
|
28
|
+
program.addCommand(channelCommand)
|
|
29
|
+
program.addCommand(userCommand)
|
|
30
|
+
program.addCommand(reactionCommand)
|
|
31
|
+
program.addCommand(fileCommand)
|
|
32
|
+
program.addCommand(snapshotCommand)
|
|
33
|
+
|
|
34
|
+
program.parse(process.argv)
|
|
35
|
+
|
|
36
|
+
export default program
|