@mirid-dev/sendkit-mcp-tools 0.0.0-stage → 0.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/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -4
- package/README.md +0 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";wBAegB,qBAAqB,QAAQ,WAAW"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { sendTelegramMessage, telegramMessageInputSchema, telegramMessageOutputSchema } from "@mirid-dev/sendkit-core";
|
|
3
|
+
// src/index.ts
|
|
4
|
+
const telegramToolOutputSchema = telegramMessageOutputSchema.extend({ sentAt: z.iso.datetime() });
|
|
5
|
+
function registerTelegramTool(server, getBotToken) {
|
|
6
|
+
server.registerTool("telegram", {
|
|
7
|
+
title: "Telegram",
|
|
8
|
+
description: "Send a Telegram message",
|
|
9
|
+
inputSchema: telegramMessageInputSchema,
|
|
10
|
+
outputSchema: telegramToolOutputSchema
|
|
11
|
+
}, async (input) => {
|
|
12
|
+
const result = await sendTelegramMessage({
|
|
13
|
+
...input,
|
|
14
|
+
botToken: getBotToken()
|
|
15
|
+
});
|
|
16
|
+
const output = {
|
|
17
|
+
...result,
|
|
18
|
+
sentAt: result.sentAt.toISOString()
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
content: [{
|
|
22
|
+
type: "text",
|
|
23
|
+
text: `Sent Telegram message ${output.messageId} to chat ${output.chatId}`
|
|
24
|
+
}],
|
|
25
|
+
structuredContent: output
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export { registerTelegramTool };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/server'\nimport { z } from 'zod'\n\nimport {\n sendTelegramMessage,\n telegramMessageInputSchema,\n telegramMessageOutputSchema,\n} from '@mirid-dev/sendkit-core'\n\n// Structured content travels as JSON, so the Date becomes an ISO string\nconst telegramToolOutputSchema = telegramMessageOutputSchema.extend({\n sentAt: z.iso.datetime(),\n})\n\n// getBotToken runs per call, so a missing token fails the call rather than server startup\nexport function registerTelegramTool(server: McpServer, getBotToken: () => string) {\n server.registerTool(\n 'telegram',\n {\n title: 'Telegram',\n description: 'Send a Telegram message',\n inputSchema: telegramMessageInputSchema,\n outputSchema: telegramToolOutputSchema,\n },\n async (input) => {\n const result = await sendTelegramMessage({\n ...input,\n botToken: getBotToken(),\n })\n\n const output = { ...result, sentAt: result.sentAt.toISOString() }\n\n return {\n content: [\n {\n type: 'text',\n text: `Sent Telegram message ${output.messageId} to chat ${output.chatId}`,\n },\n ],\n structuredContent: output,\n }\n },\n )\n}\n"],"mappings":";;;AAUA,MAAM,2BAA2B,4BAA4B,OAAO,EAClE,QAAQ,EAAE,IAAI,SAAS,EACzB,CAAC;AAGD,SAAgB,qBAAqB,QAAmB,aAA2B;CACjF,OAAO,aACL,YACA;EACE,OAAO;EACP,aAAa;EACb,aAAa;EACb,cAAc;CAChB,GACA,OAAO,UAAU;EACf,MAAM,SAAS,MAAM,oBAAoB;GACvC,GAAG;GACH,UAAU,YAAY;EACxB,CAAC;EAED,MAAM,SAAS;GAAE,GAAG;GAAQ,QAAQ,OAAO,OAAO,YAAY;EAAE;EAEhE,OAAO;GACL,SAAS,CACP;IACE,MAAM;IACN,MAAM,yBAAyB,OAAO,UAAU,WAAW,OAAO;GACpE,CACF;GACA,mBAAmB;EACrB;CACF,CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirid-dev/sendkit-mcp-tools",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsdown",
|
|
23
|
+
"pack:dry": "bun run build && bun pm pack --dry-run",
|
|
24
|
+
"prepublishOnly": "bun run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@mirid-dev/sendkit-core": "0.0.0",
|
|
28
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
29
|
+
"zod": "^4.6.7"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/README.md
DELETED