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,130 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# post-message.sh - Send a message to Slack with error handling
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# ./post-message.sh <channel> <message>
|
|
7
|
+
#
|
|
8
|
+
# Example:
|
|
9
|
+
# ./post-message.sh general "Hello from script!"
|
|
10
|
+
# ./post-message.sh engineering "Deployment completed ✅"
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
# Check arguments
|
|
15
|
+
if [ $# -lt 2 ]; then
|
|
16
|
+
echo "Usage: $0 <channel> <message>"
|
|
17
|
+
echo ""
|
|
18
|
+
echo "Examples:"
|
|
19
|
+
echo " $0 general 'Hello world!'"
|
|
20
|
+
echo " $0 engineering 'Build completed'"
|
|
21
|
+
exit 1
|
|
22
|
+
fi
|
|
23
|
+
|
|
24
|
+
CHANNEL="$1"
|
|
25
|
+
MESSAGE="$2"
|
|
26
|
+
|
|
27
|
+
# Colors for output
|
|
28
|
+
RED='\033[0;31m'
|
|
29
|
+
GREEN='\033[0;32m'
|
|
30
|
+
YELLOW='\033[1;33m'
|
|
31
|
+
NC='\033[0m' # No Color
|
|
32
|
+
|
|
33
|
+
# Function to send message with retry logic
|
|
34
|
+
send_message() {
|
|
35
|
+
local channel=$1
|
|
36
|
+
local message=$2
|
|
37
|
+
local max_attempts=3
|
|
38
|
+
local attempt=1
|
|
39
|
+
|
|
40
|
+
while [ $attempt -le $max_attempts ]; do
|
|
41
|
+
echo -e "${YELLOW}Attempt $attempt/$max_attempts...${NC}"
|
|
42
|
+
|
|
43
|
+
# Send message and capture result
|
|
44
|
+
RESULT=$(agent-slack message send "$channel" "$message" 2>&1)
|
|
45
|
+
|
|
46
|
+
# Check if successful
|
|
47
|
+
if echo "$RESULT" | jq -e '.success' > /dev/null 2>&1; then
|
|
48
|
+
echo -e "${GREEN}✓ Message sent successfully!${NC}"
|
|
49
|
+
|
|
50
|
+
# Extract message details
|
|
51
|
+
MSG_TS=$(echo "$RESULT" | jq -r '.data.ts')
|
|
52
|
+
|
|
53
|
+
echo ""
|
|
54
|
+
echo "Message details:"
|
|
55
|
+
echo " Channel: $channel"
|
|
56
|
+
echo " Timestamp: $MSG_TS"
|
|
57
|
+
|
|
58
|
+
return 0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
# Extract error information
|
|
62
|
+
if echo "$RESULT" | jq -e '.error' > /dev/null 2>&1; then
|
|
63
|
+
ERROR_CODE=$(echo "$RESULT" | jq -r '.error.code // "UNKNOWN"')
|
|
64
|
+
ERROR_MSG=$(echo "$RESULT" | jq -r '.error.message // "Unknown error"')
|
|
65
|
+
|
|
66
|
+
echo -e "${RED}✗ Failed: $ERROR_MSG${NC}"
|
|
67
|
+
|
|
68
|
+
# Don't retry on certain errors
|
|
69
|
+
case "$ERROR_CODE" in
|
|
70
|
+
"NO_WORKSPACE")
|
|
71
|
+
echo ""
|
|
72
|
+
echo "No workspace authenticated. Run:"
|
|
73
|
+
echo " agent-slack auth extract"
|
|
74
|
+
return 1
|
|
75
|
+
;;
|
|
76
|
+
"INVALID_CHANNEL")
|
|
77
|
+
echo ""
|
|
78
|
+
echo "Channel '$channel' not found. Check channel name or ID."
|
|
79
|
+
return 1
|
|
80
|
+
;;
|
|
81
|
+
esac
|
|
82
|
+
else
|
|
83
|
+
echo -e "${RED}✗ Unexpected error: $RESULT${NC}"
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Exponential backoff before retry
|
|
87
|
+
if [ $attempt -lt $max_attempts ]; then
|
|
88
|
+
SLEEP_TIME=$((attempt * 2))
|
|
89
|
+
echo "Retrying in ${SLEEP_TIME}s..."
|
|
90
|
+
sleep $SLEEP_TIME
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
attempt=$((attempt + 1))
|
|
94
|
+
done
|
|
95
|
+
|
|
96
|
+
echo -e "${RED}Failed after $max_attempts attempts${NC}"
|
|
97
|
+
return 1
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
# Check if agent-slack is installed
|
|
101
|
+
if ! command -v agent-slack &> /dev/null; then
|
|
102
|
+
echo -e "${RED}Error: agent-slack not found${NC}"
|
|
103
|
+
echo ""
|
|
104
|
+
echo "Install it with:"
|
|
105
|
+
echo " bun install -g agent-slack"
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
# Check authentication
|
|
110
|
+
echo "Checking authentication..."
|
|
111
|
+
AUTH_STATUS=$(agent-slack auth status 2>&1)
|
|
112
|
+
|
|
113
|
+
if ! echo "$AUTH_STATUS" | jq -e '.success' > /dev/null 2>&1; then
|
|
114
|
+
echo -e "${RED}Not authenticated!${NC}"
|
|
115
|
+
echo ""
|
|
116
|
+
echo "Run this to authenticate:"
|
|
117
|
+
echo " agent-slack auth extract"
|
|
118
|
+
exit 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
WORKSPACE_NAME=$(echo "$AUTH_STATUS" | jq -r '.data.workspace_name // "Unknown"')
|
|
122
|
+
echo -e "${GREEN}✓ Authenticated to: $WORKSPACE_NAME${NC}"
|
|
123
|
+
echo ""
|
|
124
|
+
|
|
125
|
+
# Send the message
|
|
126
|
+
echo "Sending message to #$CHANNEL..."
|
|
127
|
+
echo "Message: $MESSAGE"
|
|
128
|
+
echo ""
|
|
129
|
+
|
|
130
|
+
send_message "$CHANNEL" "$MESSAGE"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# workspace-summary.sh - Generate a comprehensive workspace summary
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# ./workspace-summary.sh [--json]
|
|
7
|
+
#
|
|
8
|
+
# Options:
|
|
9
|
+
# --json Output raw JSON instead of formatted text
|
|
10
|
+
#
|
|
11
|
+
# Example:
|
|
12
|
+
# ./workspace-summary.sh
|
|
13
|
+
# ./workspace-summary.sh --json > summary.json
|
|
14
|
+
|
|
15
|
+
set -euo pipefail
|
|
16
|
+
|
|
17
|
+
OUTPUT_JSON=false
|
|
18
|
+
if [ $# -gt 0 ] && [ "$1" = "--json" ]; then
|
|
19
|
+
OUTPUT_JSON=true
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
RED='\033[0;31m'
|
|
23
|
+
GREEN='\033[0;32m'
|
|
24
|
+
YELLOW='\033[1;33m'
|
|
25
|
+
BLUE='\033[0;34m'
|
|
26
|
+
CYAN='\033[0;36m'
|
|
27
|
+
BOLD='\033[1m'
|
|
28
|
+
NC='\033[0m'
|
|
29
|
+
|
|
30
|
+
if ! command -v agent-slack &> /dev/null; then
|
|
31
|
+
echo -e "${RED}Error: agent-slack not found${NC}" >&2
|
|
32
|
+
echo "" >&2
|
|
33
|
+
echo "Install it with:" >&2
|
|
34
|
+
echo " npm install -g agent-slack" >&2
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
AUTH_STATUS=$(agent-slack auth status 2>&1)
|
|
39
|
+
|
|
40
|
+
if echo "$AUTH_STATUS" | jq -e '.error' > /dev/null 2>&1; then
|
|
41
|
+
echo -e "${RED}Not authenticated!${NC}" >&2
|
|
42
|
+
echo "" >&2
|
|
43
|
+
echo "Run this to authenticate:" >&2
|
|
44
|
+
echo " agent-slack auth extract" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo -e "${YELLOW}Fetching workspace snapshot...${NC}" >&2
|
|
49
|
+
SNAPSHOT=$(agent-slack snapshot 2>&1)
|
|
50
|
+
|
|
51
|
+
if echo "$SNAPSHOT" | jq -e '.error' > /dev/null 2>&1; then
|
|
52
|
+
echo -e "${RED}Failed to get snapshot${NC}" >&2
|
|
53
|
+
ERROR_MSG=$(echo "$SNAPSHOT" | jq -r '.error // "Unknown error"')
|
|
54
|
+
echo -e "${RED}Error: $ERROR_MSG${NC}" >&2
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
if [ "$OUTPUT_JSON" = true ]; then
|
|
59
|
+
echo "$SNAPSHOT"
|
|
60
|
+
exit 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
WORKSPACE_NAME=$(echo "$SNAPSHOT" | jq -r '.workspace.name // "Unknown"')
|
|
64
|
+
WORKSPACE_ID=$(echo "$SNAPSHOT" | jq -r '.workspace.id // "Unknown"')
|
|
65
|
+
|
|
66
|
+
CHANNELS=$(echo "$SNAPSHOT" | jq '.channels // []')
|
|
67
|
+
CHANNEL_COUNT=$(echo "$CHANNELS" | jq 'length')
|
|
68
|
+
PUBLIC_COUNT=$(echo "$CHANNELS" | jq '[.[] | select(.is_private == false)] | length')
|
|
69
|
+
PRIVATE_COUNT=$(echo "$CHANNELS" | jq '[.[] | select(.is_private == true)] | length')
|
|
70
|
+
|
|
71
|
+
USERS=$(echo "$SNAPSHOT" | jq '.users // []')
|
|
72
|
+
USER_COUNT=$(echo "$USERS" | jq 'length')
|
|
73
|
+
|
|
74
|
+
MESSAGES=$(echo "$SNAPSHOT" | jq '.recent_messages // []')
|
|
75
|
+
MESSAGE_COUNT=$(echo "$MESSAGES" | jq 'length')
|
|
76
|
+
|
|
77
|
+
echo ""
|
|
78
|
+
echo -e "${BOLD}${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
79
|
+
echo -e "${BOLD}${BLUE} Slack Workspace Summary${NC}"
|
|
80
|
+
echo -e "${BOLD}${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
81
|
+
echo ""
|
|
82
|
+
echo -e "${BOLD}Workspace:${NC} $WORKSPACE_NAME"
|
|
83
|
+
echo -e "${BOLD}ID:${NC} $WORKSPACE_ID"
|
|
84
|
+
echo ""
|
|
85
|
+
|
|
86
|
+
echo -e "${BOLD}${CYAN}Channels (${CHANNEL_COUNT} total)${NC}"
|
|
87
|
+
echo -e " Public: $PUBLIC_COUNT"
|
|
88
|
+
echo -e " Private: $PRIVATE_COUNT"
|
|
89
|
+
echo ""
|
|
90
|
+
|
|
91
|
+
echo -e "${BOLD}${CYAN}Channel List:${NC}"
|
|
92
|
+
echo "$CHANNELS" | jq -r '
|
|
93
|
+
.[0:10] |
|
|
94
|
+
.[] |
|
|
95
|
+
" #\(.name) (\(.id))"
|
|
96
|
+
'
|
|
97
|
+
if [ "$CHANNEL_COUNT" -gt 10 ]; then
|
|
98
|
+
echo " ... and $((CHANNEL_COUNT - 10)) more"
|
|
99
|
+
fi
|
|
100
|
+
echo ""
|
|
101
|
+
|
|
102
|
+
echo -e "${BOLD}${CYAN}Users (${USER_COUNT} total)${NC}"
|
|
103
|
+
echo ""
|
|
104
|
+
|
|
105
|
+
echo -e "${BOLD}${CYAN}Sample Users:${NC}"
|
|
106
|
+
echo "$USERS" | jq -r '
|
|
107
|
+
.[0:10] |
|
|
108
|
+
.[] |
|
|
109
|
+
" \(.name) - \(.real_name // "N/A") (\(.id))"
|
|
110
|
+
'
|
|
111
|
+
if [ "$USER_COUNT" -gt 10 ]; then
|
|
112
|
+
echo " ... and $((USER_COUNT - 10)) more"
|
|
113
|
+
fi
|
|
114
|
+
echo ""
|
|
115
|
+
|
|
116
|
+
echo -e "${BOLD}${CYAN}Recent Activity (${MESSAGE_COUNT} messages)${NC}"
|
|
117
|
+
echo ""
|
|
118
|
+
|
|
119
|
+
if [ "$MESSAGE_COUNT" -gt 0 ]; then
|
|
120
|
+
echo -e "${BOLD}${CYAN}Latest Messages:${NC}"
|
|
121
|
+
echo "$MESSAGES" | jq -r '
|
|
122
|
+
.[0:5] |
|
|
123
|
+
.[] |
|
|
124
|
+
" [\(.channel_name)] \(.username // "Unknown"): \(.text[0:60])\(if (.text | length) > 60 then "..." else "" end)"
|
|
125
|
+
'
|
|
126
|
+
echo ""
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
echo -e "${BOLD}${CYAN}Quick Actions:${NC}"
|
|
130
|
+
echo ""
|
|
131
|
+
echo -e " ${GREEN}# Send message to a channel${NC}"
|
|
132
|
+
FIRST_CHANNEL=$(echo "$CHANNELS" | jq -r '.[0].name // "general"')
|
|
133
|
+
echo -e " agent-slack message send $FIRST_CHANNEL \"Hello!\""
|
|
134
|
+
echo ""
|
|
135
|
+
echo -e " ${GREEN}# List recent messages in a channel${NC}"
|
|
136
|
+
echo -e " agent-slack message list $FIRST_CHANNEL --limit 10"
|
|
137
|
+
echo ""
|
|
138
|
+
echo -e " ${GREEN}# Get user info${NC}"
|
|
139
|
+
FIRST_USER=$(echo "$USERS" | jq -r '.[0].id // "U123"')
|
|
140
|
+
echo -e " agent-slack user info $FIRST_USER"
|
|
141
|
+
echo ""
|
|
142
|
+
|
|
143
|
+
echo -e "${BOLD}${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
|
144
|
+
echo ""
|
|
145
|
+
|
|
146
|
+
SNAPSHOT_FILE="workspace-snapshot-$(date +%Y%m%d-%H%M%S).json"
|
|
147
|
+
echo "$SNAPSHOT" > "$SNAPSHOT_FILE"
|
|
148
|
+
echo -e "${GREEN}✓ Full snapshot saved to: $SNAPSHOT_FILE${NC}"
|
|
149
|
+
echo ""
|
package/src/cli.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
import pkg from '../package.json'
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
9
|
+
const __dirname = dirname(__filename)
|
|
10
|
+
|
|
11
|
+
const program = new Command()
|
|
12
|
+
|
|
13
|
+
program
|
|
14
|
+
.name('agent-messenger')
|
|
15
|
+
.description('Multi-platform messaging CLI for AI agents')
|
|
16
|
+
.version(pkg.version)
|
|
17
|
+
|
|
18
|
+
// Use absolute paths for CWD-independence
|
|
19
|
+
program.command('slack', 'Interact with Slack workspaces', {
|
|
20
|
+
executableFile: join(__dirname, 'platforms', 'slack', 'cli.ts'),
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
program.command('discord', 'Interact with Discord guilds', {
|
|
24
|
+
executableFile: join(__dirname, 'platforms', 'discord', 'cli.ts'),
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
program.parse(process.argv)
|
|
28
|
+
|
|
29
|
+
export default program
|
|
@@ -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
|
+
guildCommand,
|
|
10
|
+
messageCommand,
|
|
11
|
+
reactionCommand,
|
|
12
|
+
snapshotCommand,
|
|
13
|
+
userCommand,
|
|
14
|
+
} from './commands'
|
|
15
|
+
|
|
16
|
+
const program = new Command()
|
|
17
|
+
|
|
18
|
+
program
|
|
19
|
+
.name('agent-discord')
|
|
20
|
+
.description('CLI tool for Discord communication')
|
|
21
|
+
.version(pkg.version)
|
|
22
|
+
.option('--pretty', 'Pretty-print JSON output')
|
|
23
|
+
.option('--guild <id>', 'Use specific guild')
|
|
24
|
+
|
|
25
|
+
program.addCommand(authCommand)
|
|
26
|
+
program.addCommand(guildCommand)
|
|
27
|
+
program.addCommand(channelCommand)
|
|
28
|
+
program.addCommand(fileCommand)
|
|
29
|
+
program.addCommand(messageCommand)
|
|
30
|
+
program.addCommand(reactionCommand)
|
|
31
|
+
program.addCommand(snapshotCommand)
|
|
32
|
+
program.addCommand(userCommand)
|
|
33
|
+
|
|
34
|
+
program.parse(process.argv)
|
|
35
|
+
|
|
36
|
+
export default program
|