social-mcp 1.0.1
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/README.md +165 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +19 -0
- package/dist/lib/config.js +20 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/http.d.ts +7 -0
- package/dist/lib/http.js +27 -0
- package/dist/lib/http.js.map +1 -0
- package/dist/run_tools_discord.d.ts +19 -0
- package/dist/run_tools_discord.js +49 -0
- package/dist/run_tools_discord.js.map +1 -0
- package/dist/run_tools_facebook.d.ts +19 -0
- package/dist/run_tools_facebook.js +49 -0
- package/dist/run_tools_facebook.js.map +1 -0
- package/dist/run_tools_instagram.d.ts +20 -0
- package/dist/run_tools_instagram.js +54 -0
- package/dist/run_tools_instagram.js.map +1 -0
- package/dist/run_tools_slack.d.ts +19 -0
- package/dist/run_tools_slack.js +49 -0
- package/dist/run_tools_slack.js.map +1 -0
- package/dist/run_tools_telegram.d.ts +20 -0
- package/dist/run_tools_telegram.js +107 -0
- package/dist/run_tools_telegram.js.map +1 -0
- package/dist/run_tools_twitter.d.ts +23 -0
- package/dist/run_tools_twitter.js +74 -0
- package/dist/run_tools_twitter.js.map +1 -0
- package/dist/run_tools_whatsapp.d.ts +20 -0
- package/dist/run_tools_whatsapp.js +58 -0
- package/dist/run_tools_whatsapp.js.map +1 -0
- package/dist/services/discord-service.d.ts +10 -0
- package/dist/services/discord-service.js +24 -0
- package/dist/services/discord-service.js.map +1 -0
- package/dist/services/facebook-service.d.ts +8 -0
- package/dist/services/facebook-service.js +22 -0
- package/dist/services/facebook-service.js.map +1 -0
- package/dist/services/instagram-service.d.ts +7 -0
- package/dist/services/instagram-service.js +28 -0
- package/dist/services/instagram-service.js.map +1 -0
- package/dist/services/slack-service.d.ts +9 -0
- package/dist/services/slack-service.js +31 -0
- package/dist/services/slack-service.js.map +1 -0
- package/dist/services/telegram-service.d.ts +29 -0
- package/dist/services/telegram-service.js +80 -0
- package/dist/services/telegram-service.js.map +1 -0
- package/dist/services/twitter-service.d.ts +10 -0
- package/dist/services/twitter-service.js +58 -0
- package/dist/services/twitter-service.js.map +1 -0
- package/dist/services/whatsapp-service.d.ts +23 -0
- package/dist/services/whatsapp-service.js +72 -0
- package/dist/services/whatsapp-service.js.map +1 -0
- package/dist/tools/discord-tools/send-message.d.ts +16 -0
- package/dist/tools/discord-tools/send-message.js +35 -0
- package/dist/tools/discord-tools/send-message.js.map +1 -0
- package/dist/tools/facebook-tools/create-post.d.ts +16 -0
- package/dist/tools/facebook-tools/create-post.js +34 -0
- package/dist/tools/facebook-tools/create-post.js.map +1 -0
- package/dist/tools/instagram-tools/create-post.d.ts +18 -0
- package/dist/tools/instagram-tools/create-post.js +35 -0
- package/dist/tools/instagram-tools/create-post.js.map +1 -0
- package/dist/tools/slack-tools/send-message.d.ts +16 -0
- package/dist/tools/slack-tools/send-message.js +34 -0
- package/dist/tools/slack-tools/send-message.js.map +1 -0
- package/dist/tools/telegram-tools/forward-message.d.ts +20 -0
- package/dist/tools/telegram-tools/forward-message.js +44 -0
- package/dist/tools/telegram-tools/forward-message.js.map +1 -0
- package/dist/tools/telegram-tools/get-channel-info.d.ts +14 -0
- package/dist/tools/telegram-tools/get-channel-info.js +39 -0
- package/dist/tools/telegram-tools/get-channel-info.js.map +1 -0
- package/dist/tools/telegram-tools/get-channel-members.d.ts +16 -0
- package/dist/tools/telegram-tools/get-channel-members.js +56 -0
- package/dist/tools/telegram-tools/get-channel-members.js.map +1 -0
- package/dist/tools/telegram-tools/pin-message.d.ts +18 -0
- package/dist/tools/telegram-tools/pin-message.js +41 -0
- package/dist/tools/telegram-tools/pin-message.js.map +1 -0
- package/dist/tools/telegram-tools/send-message.d.ts +16 -0
- package/dist/tools/telegram-tools/send-message.js +38 -0
- package/dist/tools/telegram-tools/send-message.js.map +1 -0
- package/dist/tools/twitter-tools/get-user-info.d.ts +14 -0
- package/dist/tools/twitter-tools/get-user-info.js +38 -0
- package/dist/tools/twitter-tools/get-user-info.js.map +1 -0
- package/dist/tools/twitter-tools/search-tweets.d.ts +16 -0
- package/dist/tools/twitter-tools/search-tweets.js +51 -0
- package/dist/tools/twitter-tools/search-tweets.js.map +1 -0
- package/dist/tools/twitter-tools/send-tweet.d.ts +14 -0
- package/dist/tools/twitter-tools/send-tweet.js +33 -0
- package/dist/tools/twitter-tools/send-tweet.js.map +1 -0
- package/dist/tools/whatsapp-tools/get-messages.d.ts +14 -0
- package/dist/tools/whatsapp-tools/get-messages.js +54 -0
- package/dist/tools/whatsapp-tools/get-messages.js.map +1 -0
- package/dist/tools/whatsapp-tools/send-message.d.ts +16 -0
- package/dist/tools/whatsapp-tools/send-message.js +34 -0
- package/dist/tools/whatsapp-tools/send-message.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/package.json +74 -0
package/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# social-mcp
|
|
2
|
+
|
|
3
|
+
An MCP (Model Context Protocol) server that lets AI assistants post and interact across social media platforms.
|
|
4
|
+
|
|
5
|
+
## Supported Platforms
|
|
6
|
+
|
|
7
|
+
| Platform | Tools |
|
|
8
|
+
|-----------|-------|
|
|
9
|
+
| Telegram | Send message, get channel info, forward message, pin message, get channel members |
|
|
10
|
+
| Twitter/X | Send tweet, get user info, search tweets |
|
|
11
|
+
| Discord | Send message |
|
|
12
|
+
| WhatsApp | Send message, get messages |
|
|
13
|
+
| Facebook | Create post |
|
|
14
|
+
| Instagram | Create post |
|
|
15
|
+
| Slack | Send message |
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Run directly with `npx` ā no install required:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx social-mcp
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or install globally:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g social-mcp
|
|
29
|
+
social-mcp
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## MCP Client Configuration
|
|
33
|
+
|
|
34
|
+
### Claude Desktop
|
|
35
|
+
|
|
36
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"social-mcp": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["social-mcp"],
|
|
44
|
+
"env": {
|
|
45
|
+
"TELEGRAM_BOT_TOKEN": "your_token",
|
|
46
|
+
"TWITTER_APP_KEY": "your_key",
|
|
47
|
+
"TWITTER_APP_SECRET": "your_secret",
|
|
48
|
+
"TWITTER_ACCESS_TOKEN": "your_token",
|
|
49
|
+
"TWITTER_ACCESS_SECRET": "your_secret",
|
|
50
|
+
"DISCORD_BOT_TOKEN": "your_token",
|
|
51
|
+
"WHATSAPP_ACCESS_TOKEN": "your_token",
|
|
52
|
+
"WHATSAPP_PHONE_NUMBER_ID": "your_id",
|
|
53
|
+
"FACEBOOK_ACCESS_TOKEN": "your_token",
|
|
54
|
+
"INSTAGRAM_ACCESS_TOKEN": "your_token",
|
|
55
|
+
"SLACK_BOT_TOKEN": "your_token"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Cursor / VS Code (via MCP extension)
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"mcp": {
|
|
67
|
+
"servers": {
|
|
68
|
+
"social-mcp": {
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["social-mcp"],
|
|
71
|
+
"env": { "...": "same env vars as above" }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Only include env vars for the platforms you actually use ā unused platforms are simply ignored.
|
|
79
|
+
|
|
80
|
+
## Environment Variables
|
|
81
|
+
|
|
82
|
+
Copy `example.env` to `.env` and fill in the credentials for the platforms you want to use.
|
|
83
|
+
|
|
84
|
+
### Telegram
|
|
85
|
+
| Variable | Description |
|
|
86
|
+
|----------|-------------|
|
|
87
|
+
| `TELEGRAM_BOT_TOKEN` | Bot token from [@BotFather](https://t.me/BotFather) |
|
|
88
|
+
|
|
89
|
+
### Twitter / X
|
|
90
|
+
| Variable | Description |
|
|
91
|
+
|----------|-------------|
|
|
92
|
+
| `TWITTER_APP_KEY` | API key from the [Twitter Developer Portal](https://developer.twitter.com) |
|
|
93
|
+
| `TWITTER_APP_SECRET` | API secret |
|
|
94
|
+
| `TWITTER_ACCESS_TOKEN` | Access token (OAuth 1.0a, Read & Write) |
|
|
95
|
+
| `TWITTER_ACCESS_SECRET` | Access token secret |
|
|
96
|
+
|
|
97
|
+
### Discord
|
|
98
|
+
| Variable | Description |
|
|
99
|
+
|----------|-------------|
|
|
100
|
+
| `DISCORD_BOT_TOKEN` | Bot token from the [Discord Developer Portal](https://discord.com/developers/applications) ā bot must have Send Messages permission |
|
|
101
|
+
|
|
102
|
+
### WhatsApp Business
|
|
103
|
+
| Variable | Description |
|
|
104
|
+
|----------|-------------|
|
|
105
|
+
| `WHATSAPP_ACCESS_TOKEN` | Access token from Meta for Developers |
|
|
106
|
+
| `WHATSAPP_PHONE_NUMBER_ID` | Phone Number ID from WhatsApp API Setup |
|
|
107
|
+
|
|
108
|
+
### Facebook
|
|
109
|
+
| Variable | Description |
|
|
110
|
+
|----------|-------------|
|
|
111
|
+
| `FACEBOOK_ACCESS_TOKEN` | Page Access Token from Meta Graph API Explorer |
|
|
112
|
+
|
|
113
|
+
### Instagram
|
|
114
|
+
| Variable | Description |
|
|
115
|
+
|----------|-------------|
|
|
116
|
+
| `INSTAGRAM_ACCESS_TOKEN` | Token with `instagram_content_publish` scope |
|
|
117
|
+
|
|
118
|
+
### Slack
|
|
119
|
+
| Variable | Description |
|
|
120
|
+
|----------|-------------|
|
|
121
|
+
| `SLACK_BOT_TOKEN` | Bot token from [api.slack.com](https://api.slack.com/apps) ā requires `chat:write` scope |
|
|
122
|
+
|
|
123
|
+
## Available Tools
|
|
124
|
+
|
|
125
|
+
### Telegram
|
|
126
|
+
- **SEND_MESSAGE** ā Send a message to a chat or channel (`chatId`, `text`)
|
|
127
|
+
- **GET_CHANNEL_INFO** ā Get channel metadata (`channelId`)
|
|
128
|
+
- **FORWARD_MESSAGE** ā Forward a message between chats (`fromChatId`, `toChatId`, `messageId`)
|
|
129
|
+
- **PIN_MESSAGE** ā Pin a message in a chat (`chatId`, `messageId`)
|
|
130
|
+
- **GET_CHANNEL_MEMBERS** ā List channel administrators (`channelId`, `limit`)
|
|
131
|
+
|
|
132
|
+
### Twitter / X
|
|
133
|
+
- **SEND_TWEET** ā Post a tweet (`text`, max 280 chars)
|
|
134
|
+
- **GET_USER_INFO** ā Get a user's profile and metrics (`username`)
|
|
135
|
+
- **SEARCH_TWEETS** ā Search recent tweets (`query`, `maxResults`)
|
|
136
|
+
|
|
137
|
+
### Discord
|
|
138
|
+
- **SEND_DISCORD_MESSAGE** ā Send a message to a channel (`channelId`, `content`)
|
|
139
|
+
|
|
140
|
+
### WhatsApp
|
|
141
|
+
- **SEND_WHATSAPP_MESSAGE** ā Send a message to a phone number in E.164 format (`to`, `text`)
|
|
142
|
+
- **GET_WHATSAPP_MESSAGES** ā Retrieve recent messages (`limit`)
|
|
143
|
+
|
|
144
|
+
### Facebook
|
|
145
|
+
- **CREATE_FACEBOOK_POST** ā Create a post on a Facebook page (`pageId`, `message`)
|
|
146
|
+
|
|
147
|
+
### Instagram
|
|
148
|
+
- **CREATE_INSTAGRAM_POST** ā Publish an image post (`userId`, `imageUrl`, `message`)
|
|
149
|
+
|
|
150
|
+
### Slack
|
|
151
|
+
- **SEND_SLACK_MESSAGE** ā Send a message to a channel (`channelId`, `text`)
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
pnpm install
|
|
157
|
+
pnpm run build # compile TypeScript
|
|
158
|
+
pnpm run watch # watch mode
|
|
159
|
+
pnpm run lint # lint with Biome
|
|
160
|
+
pnpm run format # format with Biome
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
ISC
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,mBAAmB;AAEnB,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAC;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { FastMCP } from "fastmcp";
|
|
3
|
+
import { forwardMessageTool } from "./tools/telegram-tools/forward-message.js";
|
|
4
|
+
import { getChannelInfoTool } from "./tools/telegram-tools/get-channel-info.js";
|
|
5
|
+
import { getChannelMembersTool } from "./tools/telegram-tools/get-channel-members.js";
|
|
6
|
+
import { pinMessageTool } from "./tools/telegram-tools/pin-message.js";
|
|
7
|
+
import { sendMessageTool } from "./tools/telegram-tools/send-message.js";
|
|
8
|
+
import { getUserInfoTool } from "./tools/twitter-tools/get-user-info.js";
|
|
9
|
+
import { searchTweetsTool } from "./tools/twitter-tools/search-tweets.js";
|
|
10
|
+
import { sendTweetTool } from "./tools/twitter-tools/send-tweet.js";
|
|
11
|
+
// Discord tools
|
|
12
|
+
import { sendMessageTool as discordSendMessageTool } from "./tools/discord-tools/send-message.js";
|
|
13
|
+
// WhatsApp tools
|
|
14
|
+
import { sendMessageTool as whatsappSendMessageTool } from "./tools/whatsapp-tools/send-message.js";
|
|
15
|
+
import { getMessagesTool as whatsappGetMessagesTool } from "./tools/whatsapp-tools/get-messages.js";
|
|
16
|
+
// Facebook tools
|
|
17
|
+
import { createPostTool as facebookCreatePostTool } from "./tools/facebook-tools/create-post.js";
|
|
18
|
+
// Instagram tools
|
|
19
|
+
import { createPostTool as instagramCreatePostTool } from "./tools/instagram-tools/create-post.js";
|
|
20
|
+
// Slack tools
|
|
21
|
+
import { sendMessageTool as slackSendMessageTool } from "./tools/slack-tools/send-message.js";
|
|
22
|
+
async function main() {
|
|
23
|
+
const server = new FastMCP({
|
|
24
|
+
name: "Social MCP Server",
|
|
25
|
+
version: "1.1.1",
|
|
26
|
+
});
|
|
27
|
+
// Add Telegram tools
|
|
28
|
+
server.addTool(sendMessageTool);
|
|
29
|
+
server.addTool(getChannelInfoTool);
|
|
30
|
+
server.addTool(forwardMessageTool);
|
|
31
|
+
server.addTool(pinMessageTool);
|
|
32
|
+
server.addTool(getChannelMembersTool);
|
|
33
|
+
// Add Twitter tools
|
|
34
|
+
server.addTool(sendTweetTool);
|
|
35
|
+
server.addTool(getUserInfoTool);
|
|
36
|
+
server.addTool(searchTweetsTool);
|
|
37
|
+
// Add Discord tools
|
|
38
|
+
server.addTool(discordSendMessageTool);
|
|
39
|
+
// Add WhatsApp tools
|
|
40
|
+
server.addTool(whatsappSendMessageTool);
|
|
41
|
+
server.addTool(whatsappGetMessagesTool);
|
|
42
|
+
// Add Facebook tools
|
|
43
|
+
server.addTool(facebookCreatePostTool);
|
|
44
|
+
// Add Instagram tools
|
|
45
|
+
server.addTool(instagramCreatePostTool);
|
|
46
|
+
// Add Slack tools
|
|
47
|
+
server.addTool(slackSendMessageTool);
|
|
48
|
+
try {
|
|
49
|
+
await server.start({
|
|
50
|
+
transportType: "stdio",
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error("Failed to start Social MCP Server:", error);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
main().catch((error) => {
|
|
59
|
+
console.error("Unexpected error in Social MCP Server:", error);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+CAA+C,CAAC;AACtF,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,gBAAgB;AAChB,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAElG,iBAAiB;AACjB,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEpG,iBAAiB;AACjB,OAAO,EAAE,cAAc,IAAI,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAEjG,kBAAkB;AAClB,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAEnG,cAAc;AACd,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE9F,KAAK,UAAU,IAAI;IAClB,MAAM,MAA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E;IACtB,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;IAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const config: {
|
|
2
|
+
discord: {
|
|
3
|
+
baseUrl: string;
|
|
4
|
+
botToken: string;
|
|
5
|
+
};
|
|
6
|
+
whatsapp: {
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
accessToken: string;
|
|
9
|
+
phoneNumberId: string;
|
|
10
|
+
};
|
|
11
|
+
facebook: {
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
accessToken: string;
|
|
14
|
+
};
|
|
15
|
+
instagram: {
|
|
16
|
+
baseUrl: string;
|
|
17
|
+
accessToken: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const config = {
|
|
2
|
+
discord: {
|
|
3
|
+
baseUrl: "https://discord.com/api/v10",
|
|
4
|
+
botToken: process.env.DISCORD_BOT_TOKEN || "",
|
|
5
|
+
},
|
|
6
|
+
whatsapp: {
|
|
7
|
+
baseUrl: "https://graph.facebook.com/v21.0",
|
|
8
|
+
accessToken: process.env.WHATSAPP_ACCESS_TOKEN || "",
|
|
9
|
+
phoneNumberId: process.env.WHATSAPP_PHONE_NUMBER_ID || "",
|
|
10
|
+
},
|
|
11
|
+
facebook: {
|
|
12
|
+
baseUrl: "https://graph.facebook.com/v21.0",
|
|
13
|
+
accessToken: process.env.FACEBOOK_ACCESS_TOKEN || "",
|
|
14
|
+
},
|
|
15
|
+
instagram: {
|
|
16
|
+
baseUrl: "https://graph.facebook.com/v21.0",
|
|
17
|
+
accessToken: process.env.INSTAGRAM_ACCESS_TOKEN || "",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,OAAO,EAAE;QACP,OAAO,EAAE,6BAA6B;QACtC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE;KAC9C;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE;QACpD,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;KAC1D;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE;KACrD;IACD,SAAS,EAAE;QACT,OAAO,EAAE,kCAAkC;QAC3C,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE;KACtD;CACF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
export declare class HttpError extends Error {
|
|
3
|
+
readonly status: number;
|
|
4
|
+
readonly data?: unknown | undefined;
|
|
5
|
+
constructor(status: number, message: string, data?: unknown | undefined);
|
|
6
|
+
}
|
|
7
|
+
export declare function fetchJson<T>(url: string, options?: RequestInit, schema?: z.ZodType<T>): Promise<T>;
|
package/dist/lib/http.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export class HttpError extends Error {
|
|
2
|
+
status;
|
|
3
|
+
data;
|
|
4
|
+
constructor(status, message, data) {
|
|
5
|
+
super(message);
|
|
6
|
+
this.status = status;
|
|
7
|
+
this.data = data;
|
|
8
|
+
this.name = "HttpError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export async function fetchJson(url, options, schema) {
|
|
12
|
+
const response = await fetch(url, options);
|
|
13
|
+
if (!response.ok) {
|
|
14
|
+
throw new HttpError(response.status, `HTTP error ${response.status}: ${response.statusText}`, await response.text().catch(() => undefined));
|
|
15
|
+
}
|
|
16
|
+
const data = await response.json();
|
|
17
|
+
if (schema) {
|
|
18
|
+
try {
|
|
19
|
+
return schema.parse(data);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
throw new Error(`Invalid response data: ${error instanceof Error ? error.message : String(error)}`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/lib/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAElB;IAEA;IAHjB,YACiB,MAAc,EAC9B,OAAe,EACC,IAAc;QAE9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,WAAM,GAAN,MAAM,CAAQ;QAEd,SAAI,GAAJ,IAAI,CAAU;QAG9B,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IACzB,CAAC;CACD;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC9B,GAAW,EACX,OAAqB,EACrB,MAAqB;IAErB,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAE3C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAClB,MAAM,IAAI,SAAS,CAClB,QAAQ,CAAC,MAAM,EACf,cAAc,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,EACvD,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAC5C,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEnC,IAAI,MAAM,EAAE,CAAC;QACZ,IAAI,CAAC;YACJ,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACd,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAClF,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO,IAAS,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Discord Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Discord MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:discord
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_discord.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* DISCORD_BOT_TOKEN - Your Discord bot token
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_DISCORD_CHANNEL_ID - The channel ID to send test messages to
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Discord Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Discord MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:discord
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_discord.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* DISCORD_BOT_TOKEN - Your Discord bot token
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_DISCORD_CHANNEL_ID - The channel ID to send test messages to
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
20
|
+
import { sendMessageTool } from "./tools/discord-tools/send-message.js";
|
|
21
|
+
const CHANNEL_ID = process.env.TEST_DISCORD_CHANNEL_ID ?? "";
|
|
22
|
+
function printSeparator(title) {
|
|
23
|
+
console.log(`\n${"ā".repeat(60)}`);
|
|
24
|
+
console.log(` ${title}`);
|
|
25
|
+
console.log("ā".repeat(60));
|
|
26
|
+
}
|
|
27
|
+
async function runDiscordTests() {
|
|
28
|
+
console.log("š Discord Tools Test Runner");
|
|
29
|
+
console.log(` DISCORD_BOT_TOKEN: ${process.env.DISCORD_BOT_TOKEN ? "ā
Set" : "ā Missing"}`);
|
|
30
|
+
console.log(` Channel ID: ${CHANNEL_ID || "(not set ā tests will be skipped)"}`);
|
|
31
|
+
// āā 1. SEND_DISCORD_MESSAGE āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
32
|
+
printSeparator("1. SEND_DISCORD_MESSAGE");
|
|
33
|
+
if (CHANNEL_ID) {
|
|
34
|
+
const result = await sendMessageTool.execute({
|
|
35
|
+
channelId: CHANNEL_ID,
|
|
36
|
+
content: "š Hello from social-mcp! This is a test message.",
|
|
37
|
+
});
|
|
38
|
+
console.log(result);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
console.log("ā ļø Skipped: set TEST_DISCORD_CHANNEL_ID in .env to run this test.");
|
|
42
|
+
}
|
|
43
|
+
console.log("\nā
Discord test runner complete.");
|
|
44
|
+
}
|
|
45
|
+
runDiscordTests().catch((err) => {
|
|
46
|
+
console.error("ā Discord test runner failed:", err);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=run_tools_discord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run_tools_discord.js","sourceRoot":"","sources":["../src/run_tools_discord.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,eAAe,C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,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Facebook Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Facebook MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:facebook
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_facebook.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* FACEBOOK_ACCESS_TOKEN - Facebook Page access token (long-lived)
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_FACEBOOK_PAGE_ID - The Facebook Page ID to post to
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Facebook Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Facebook MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:facebook
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_facebook.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* FACEBOOK_ACCESS_TOKEN - Facebook Page access token (long-lived)
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_FACEBOOK_PAGE_ID - The Facebook Page ID to post to
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
20
|
+
import { createPostTool } from "./tools/facebook-tools/create-post.js";
|
|
21
|
+
const PAGE_ID = process.env.TEST_FACEBOOK_PAGE_ID ?? "";
|
|
22
|
+
function printSeparator(title) {
|
|
23
|
+
console.log(`\n${"ā".repeat(60)}`);
|
|
24
|
+
console.log(` ${title}`);
|
|
25
|
+
console.log("ā".repeat(60));
|
|
26
|
+
}
|
|
27
|
+
async function runFacebookTests() {
|
|
28
|
+
console.log("š Facebook Tools Test Runner");
|
|
29
|
+
console.log(` FACEBOOK_ACCESS_TOKEN: ${process.env.FACEBOOK_ACCESS_TOKEN ? "ā
Set" : "ā Missing"}`);
|
|
30
|
+
console.log(` Page ID: ${PAGE_ID || "(not set ā test will be skipped)"}`);
|
|
31
|
+
// āā 1. CREATE_FACEBOOK_POST āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
32
|
+
printSeparator("1. CREATE_FACEBOOK_POST");
|
|
33
|
+
if (PAGE_ID) {
|
|
34
|
+
const result = await createPostTool.execute({
|
|
35
|
+
pageId: PAGE_ID,
|
|
36
|
+
message: "š Hello from social-mcp! This is a test post. #mcp #test",
|
|
37
|
+
});
|
|
38
|
+
console.log(result);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
console.log("ā ļø Skipped: set TEST_FACEBOOK_PAGE_ID in .env to run this test.");
|
|
42
|
+
}
|
|
43
|
+
console.log("\nā
Facebook test runner complete.");
|
|
44
|
+
}
|
|
45
|
+
runFacebookTests().catch((err) => {
|
|
46
|
+
console.error("ā Facebook test runner failed:", err);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=run_tools_facebook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run_tools_facebook.js","sourceRoot":"","sources":["../src/run_tools_facebook.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,EAAE,CAAC;AAExD,SAAS,cAAc,CAAC,KAAa;IACpC,OAAO,CA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|
+
* Tests all Instagram MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:instagram
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_instagram.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* INSTAGRAM_ACCESS_TOKEN - Instagram Graph API access token
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_INSTAGRAM_USER_ID - Your Instagram Business/Creator account user ID
|
|
18
|
+
* TEST_INSTAGRAM_IMAGE_URL - Publicly accessible URL of an image to post
|
|
19
|
+
*/
|
|
20
|
+
import "dotenv/config";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Instagram Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Instagram MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:instagram
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_instagram.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* INSTAGRAM_ACCESS_TOKEN - Instagram Graph API access token
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_INSTAGRAM_USER_ID - Your Instagram Business/Creator account user ID
|
|
18
|
+
* TEST_INSTAGRAM_IMAGE_URL - Publicly accessible URL of an image to post
|
|
19
|
+
*/
|
|
20
|
+
import "dotenv/config";
|
|
21
|
+
import { createPostTool } from "./tools/instagram-tools/create-post.js";
|
|
22
|
+
const USER_ID = process.env.TEST_INSTAGRAM_USER_ID ?? "";
|
|
23
|
+
const IMAGE_URL = process.env.TEST_INSTAGRAM_IMAGE_URL ??
|
|
24
|
+
"https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1080";
|
|
25
|
+
function printSeparator(title) {
|
|
26
|
+
console.log(`\n${"ā".repeat(60)}`);
|
|
27
|
+
console.log(` ${title}`);
|
|
28
|
+
console.log("ā".repeat(60));
|
|
29
|
+
}
|
|
30
|
+
async function runInstagramTests() {
|
|
31
|
+
console.log("š Instagram Tools Test Runner");
|
|
32
|
+
console.log(` INSTAGRAM_ACCESS_TOKEN: ${process.env.INSTAGRAM_ACCESS_TOKEN ? "ā
Set" : "ā Missing"}`);
|
|
33
|
+
console.log(` User ID: ${USER_ID || "(not set ā test will be skipped)"}`);
|
|
34
|
+
console.log(` Image URL: ${IMAGE_URL}`);
|
|
35
|
+
// āā 1. CREATE_INSTAGRAM_POST āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
36
|
+
printSeparator("1. CREATE_INSTAGRAM_POST");
|
|
37
|
+
if (USER_ID) {
|
|
38
|
+
const result = await createPostTool.execute({
|
|
39
|
+
userId: USER_ID,
|
|
40
|
+
imageUrl: IMAGE_URL,
|
|
41
|
+
message: "šø Test post from social-mcp! #mcp #test",
|
|
42
|
+
});
|
|
43
|
+
console.log(result);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log("ā ļø Skipped: set TEST_INSTAGRAM_USER_ID in .env to run this test.");
|
|
47
|
+
}
|
|
48
|
+
console.log("\nā
Instagram test runner complete.");
|
|
49
|
+
}
|
|
50
|
+
runInstagramTests().catch((err) => {
|
|
51
|
+
console.error("ā Instagram test runner failed:", err);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=run_tools_instagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run_tools_instagram.js","sourceRoot":"","sources":["../src/run_tools_instagram.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,MAAM,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AC,GAAG,EAAE,EAAE;IACjC,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Slack Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Slack MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:slack
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_slack.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* SLACK_BOT_TOKEN - Your Slack bot OAuth token (xoxb-...)
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_SLACK_CHANNEL_ID - Slack channel ID (e.g. C1234567890) or name (#general)
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Slack Tools Test Runner
|
|
4
|
+
*
|
|
5
|
+
* Tests all Slack MCP tools against the real API.
|
|
6
|
+
* Set environment variables in .env before running.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* pnpm run:slack
|
|
10
|
+
* -- or after build --
|
|
11
|
+
* node dist/run_tools_slack.js
|
|
12
|
+
*
|
|
13
|
+
* Required env vars:
|
|
14
|
+
* SLACK_BOT_TOKEN - Your Slack bot OAuth token (xoxb-...)
|
|
15
|
+
*
|
|
16
|
+
* Optional env vars (for testing):
|
|
17
|
+
* TEST_SLACK_CHANNEL_ID - Slack channel ID (e.g. C1234567890) or name (#general)
|
|
18
|
+
*/
|
|
19
|
+
import "dotenv/config";
|
|
20
|
+
import { sendMessageTool } from "./tools/slack-tools/send-message.js";
|
|
21
|
+
const CHANNEL_ID = process.env.TEST_SLACK_CHANNEL_ID ?? "";
|
|
22
|
+
function printSeparator(title) {
|
|
23
|
+
console.log(`\n${"ā".repeat(60)}`);
|
|
24
|
+
console.log(` ${title}`);
|
|
25
|
+
console.log("ā".repeat(60));
|
|
26
|
+
}
|
|
27
|
+
async function runSlackTests() {
|
|
28
|
+
console.log("š Slack Tools Test Runner");
|
|
29
|
+
console.log(` SLACK_BOT_TOKEN: ${process.env.SLACK_BOT_TOKEN ? "ā
Set" : "ā Missing"}`);
|
|
30
|
+
console.log(` Channel ID: ${CHANNEL_ID || "(not set ā test will be skipped)"}`);
|
|
31
|
+
// āā 1. SEND_SLACK_MESSAGE āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
32
|
+
printSeparator("1. SEND_SLACK_MESSAGE");
|
|
33
|
+
if (CHANNEL_ID) {
|
|
34
|
+
const result = await sendMessageTool.execute({
|
|
35
|
+
channelId: CHANNEL_ID,
|
|
36
|
+
text: "š Hello from social-mcp! This is a test message. :robot_face:",
|
|
37
|
+
});
|
|
38
|
+
console.log(result);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
console.log("ā ļø Skipped: set TEST_SLACK_CHANNEL_ID in .env to run this test.");
|
|
42
|
+
}
|
|
43
|
+
console.log("\nā
Slack test runner complete.");
|
|
44
|
+
}
|
|
45
|
+
runSlackTests().catch((err) => {
|
|
46
|
+
console.error("ā Slack test runner failed:", err);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=run_tools_slack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run_tools_slack.js","sourceRoot":"","sources":["../src/run_tools_slack.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAEtE,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