@deadragdoll/tellymcp 0.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.
Files changed (124) hide show
  1. package/.env.example.client +93 -0
  2. package/.env.example.gateway +120 -0
  3. package/CHANGELOG.md +155 -0
  4. package/LICENSE +21 -0
  5. package/README-ru.md +338 -0
  6. package/README.md +1262 -0
  7. package/STANDALONE-ru.md +266 -0
  8. package/STANDALONE.md +266 -0
  9. package/TOOLS.md +1296 -0
  10. package/config/templates/env.both.template +83 -0
  11. package/config/templates/env.client.template +60 -0
  12. package/config/templates/env.gateway.template +82 -0
  13. package/dist/cli.js +636 -0
  14. package/dist/index.js +17 -0
  15. package/dist/lib/logfeed/store.js +52 -0
  16. package/dist/lib/middlewares/tracer.js +172 -0
  17. package/dist/lib/mixins/db.js +267 -0
  18. package/dist/lib/mixins/logfeed.js +34 -0
  19. package/dist/lib/mixins/session.errors.js +142 -0
  20. package/dist/lib/moleculer.js +2 -0
  21. package/dist/lib/trace.js +147 -0
  22. package/dist/lib/traceContext.js +116 -0
  23. package/dist/moleculer.config.js +274 -0
  24. package/dist/services/features/telegram-mcp/approval.service.js +33 -0
  25. package/dist/services/features/telegram-mcp/browser.service.js +42 -0
  26. package/dist/services/features/telegram-mcp/collaboration.service.js +53 -0
  27. package/dist/services/features/telegram-mcp/ensuredb.service.js +337 -0
  28. package/dist/services/features/telegram-mcp/gateway-delivery.service.js +378 -0
  29. package/dist/services/features/telegram-mcp/gateway-loopback.js +10 -0
  30. package/dist/services/features/telegram-mcp/gateway-rmq.service.js +294 -0
  31. package/dist/services/features/telegram-mcp/gateway-socket.service.js +1463 -0
  32. package/dist/services/features/telegram-mcp/gateway.service.js +1141 -0
  33. package/dist/services/features/telegram-mcp/inbox.service.js +33 -0
  34. package/dist/services/features/telegram-mcp/mcp-http.service.js +76 -0
  35. package/dist/services/features/telegram-mcp/mcp-server.service.js +127 -0
  36. package/dist/services/features/telegram-mcp/notify.service.js +33 -0
  37. package/dist/services/features/telegram-mcp/pair.service.js +33 -0
  38. package/dist/services/features/telegram-mcp/runtime.service.js +36 -0
  39. package/dist/services/features/telegram-mcp/session-context.service.js +33 -0
  40. package/dist/services/features/telegram-mcp/src/app/bootstrap/runtime.js +103 -0
  41. package/dist/services/features/telegram-mcp/src/app/config/env.js +317 -0
  42. package/dist/services/features/telegram-mcp/src/app/http.js +774 -0
  43. package/dist/services/features/telegram-mcp/src/app/index.js +2 -0
  44. package/dist/services/features/telegram-mcp/src/app/providers/mcp/server.js +13 -0
  45. package/dist/services/features/telegram-mcp/src/app/providers/redis/client.js +18 -0
  46. package/dist/services/features/telegram-mcp/src/app/webapp/assets.js +740 -0
  47. package/dist/services/features/telegram-mcp/src/app/webapp/auth.js +267 -0
  48. package/dist/services/features/telegram-mcp/src/app/webapp/relay.js +69 -0
  49. package/dist/services/features/telegram-mcp/src/app/webapp/tmux.js +9 -0
  50. package/dist/services/features/telegram-mcp/src/entities/auth/model/types.js +2 -0
  51. package/dist/services/features/telegram-mcp/src/entities/browser/model/types.js +2 -0
  52. package/dist/services/features/telegram-mcp/src/entities/collaboration/model/types.js +2 -0
  53. package/dist/services/features/telegram-mcp/src/entities/inbox/model/types.js +2 -0
  54. package/dist/services/features/telegram-mcp/src/entities/request/model/schema.js +545 -0
  55. package/dist/services/features/telegram-mcp/src/entities/request/model/types.js +2 -0
  56. package/dist/services/features/telegram-mcp/src/entities/session/model/types.js +2 -0
  57. package/dist/services/features/telegram-mcp/src/features/ask-user/model/askUserTelegram.js +33 -0
  58. package/dist/services/features/telegram-mcp/src/features/browser/model/browserClearLogsTool.js +28 -0
  59. package/dist/services/features/telegram-mcp/src/features/browser/model/browserClickTool.js +28 -0
  60. package/dist/services/features/telegram-mcp/src/features/browser/model/browserCloseTool.js +28 -0
  61. package/dist/services/features/telegram-mcp/src/features/browser/model/browserComputedStyleTool.js +28 -0
  62. package/dist/services/features/telegram-mcp/src/features/browser/model/browserConsoleTool.js +28 -0
  63. package/dist/services/features/telegram-mcp/src/features/browser/model/browserDomTool.js +28 -0
  64. package/dist/services/features/telegram-mcp/src/features/browser/model/browserErrorsTool.js +28 -0
  65. package/dist/services/features/telegram-mcp/src/features/browser/model/browserFillTool.js +28 -0
  66. package/dist/services/features/telegram-mcp/src/features/browser/model/browserNetworkFailuresTool.js +28 -0
  67. package/dist/services/features/telegram-mcp/src/features/browser/model/browserOpenTool.js +33 -0
  68. package/dist/services/features/telegram-mcp/src/features/browser/model/browserPressTool.js +28 -0
  69. package/dist/services/features/telegram-mcp/src/features/browser/model/browserReloadTool.js +28 -0
  70. package/dist/services/features/telegram-mcp/src/features/browser/model/browserScreenshotTool.js +28 -0
  71. package/dist/services/features/telegram-mcp/src/features/browser/model/browserService.js +689 -0
  72. package/dist/services/features/telegram-mcp/src/features/browser/model/browserWaitForTool.js +28 -0
  73. package/dist/services/features/telegram-mcp/src/features/browser/model/browserWaitForUrlTool.js +28 -0
  74. package/dist/services/features/telegram-mcp/src/features/collaboration/model/backend.js +2 -0
  75. package/dist/services/features/telegram-mcp/src/features/collaboration/model/collaborationService.js +26 -0
  76. package/dist/services/features/telegram-mcp/src/features/collaboration/model/localCollaborationBackend.js +390 -0
  77. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileService.js +102 -0
  78. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileTool.js +33 -0
  79. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerNoteTool.js +33 -0
  80. package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayCollaborationBackend.js +69 -0
  81. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayHttpService.js +657 -0
  82. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayReplyResolution.js +17 -0
  83. package/dist/services/features/telegram-mcp/src/features/inbox/model/deleteTelegramInboxMessageTool.js +33 -0
  84. package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxCountTool.js +33 -0
  85. package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxTool.js +33 -0
  86. package/dist/services/features/telegram-mcp/src/features/inbox/model/inboxService.js +77 -0
  87. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyService.js +93 -0
  88. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyTelegramTool.js +33 -0
  89. package/dist/services/features/telegram-mcp/src/features/pair-session/model/clearSessionPairingTool.js +33 -0
  90. package/dist/services/features/telegram-mcp/src/features/pair-session/model/createSessionPairCodeTool.js +33 -0
  91. package/dist/services/features/telegram-mcp/src/features/pair-session/model/generatePairCode.js +202 -0
  92. package/dist/services/features/telegram-mcp/src/features/session-context/model/clearSessionContextTool.js +33 -0
  93. package/dist/services/features/telegram-mcp/src/features/session-context/model/getSessionContextTool.js +33 -0
  94. package/dist/services/features/telegram-mcp/src/features/session-context/model/getTmuxTargetTool.js +33 -0
  95. package/dist/services/features/telegram-mcp/src/features/session-context/model/renameSessionTool.js +33 -0
  96. package/dist/services/features/telegram-mcp/src/features/session-context/model/sessionContextService.js +409 -0
  97. package/dist/services/features/telegram-mcp/src/features/session-context/model/setSessionContextTool.js +33 -0
  98. package/dist/services/features/telegram-mcp/src/features/session-context/model/setTmuxTargetTool.js +33 -0
  99. package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownService.js +123 -0
  100. package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownTool.js +33 -0
  101. package/dist/services/features/telegram-mcp/src/processes/human-approval/model/orchestrator.js +243 -0
  102. package/dist/services/features/telegram-mcp/src/shared/api/storage/contract.js +2 -0
  103. package/dist/services/features/telegram-mcp/src/shared/api/tool-registry/registry.js +8 -0
  104. package/dist/services/features/telegram-mcp/src/shared/api/tool-registry/types.js +2 -0
  105. package/dist/services/features/telegram-mcp/src/shared/api/transport/contract.js +2 -0
  106. package/dist/services/features/telegram-mcp/src/shared/integrations/object-storage/minioExchangeStore.js +86 -0
  107. package/dist/services/features/telegram-mcp/src/shared/integrations/redis/stateStore.js +436 -0
  108. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/collabSemantics.js +21 -0
  109. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/collabUi.js +87 -0
  110. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/messageFormat.js +60 -0
  111. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/proxyFetch.js +46 -0
  112. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transport.js +6534 -0
  113. package/dist/services/features/telegram-mcp/src/shared/integrations/tmux/client.js +280 -0
  114. package/dist/services/features/telegram-mcp/src/shared/lib/ids/ids.js +34 -0
  115. package/dist/services/features/telegram-mcp/src/shared/lib/logger/logger.js +68 -0
  116. package/dist/services/features/telegram-mcp/src/shared/lib/project-identity/projectIdentity.js +223 -0
  117. package/dist/services/features/telegram-mcp/src/shared/lib/redact-secrets/redactSecrets.js +22 -0
  118. package/dist/services/features/telegram-mcp/src/shared/lib/truncate/truncate.js +12 -0
  119. package/dist/services/features/telegram-mcp/src/shared/lib/version/versionHandshake.js +124 -0
  120. package/dist/services/features/telegram-mcp/src/shared/types/common.js +2 -0
  121. package/dist/services/features/telegram-mcp/standalone-http.service.js +113 -0
  122. package/dist/services/features/telegram-mcp/tools-sync.service.js +33 -0
  123. package/package.json +110 -0
  124. package/scripts/postinstall.js +60 -0
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TELLYMCP_CAPABILITIES = exports.TELLYMCP_PROTOCOL_VERSION = void 0;
7
+ exports.parseProtocolVersion = parseProtocolVersion;
8
+ exports.evaluateVersionCompatibility = evaluateVersionCompatibility;
9
+ exports.findPackageRoot = findPackageRoot;
10
+ exports.getTellyMcpPackageVersion = getTellyMcpPackageVersion;
11
+ const node_fs_1 = require("node:fs");
12
+ const node_path_1 = __importDefault(require("node:path"));
13
+ exports.TELLYMCP_PROTOCOL_VERSION = "1.0";
14
+ exports.TELLYMCP_CAPABILITIES = [
15
+ "collab_projects",
16
+ "delivery_status_push",
17
+ "live_approval",
18
+ "live_relay",
19
+ "send_partner_file",
20
+ "tools_sync",
21
+ "version_handshake",
22
+ ];
23
+ function parseProtocolVersion(value) {
24
+ if (!value?.trim()) {
25
+ return null;
26
+ }
27
+ const match = value.trim().match(/^(\d+)\.(\d+)$/u);
28
+ if (!match) {
29
+ return null;
30
+ }
31
+ return {
32
+ major: Number(match[1]),
33
+ minor: Number(match[2]),
34
+ };
35
+ }
36
+ function mergeCompatibility(current, next) {
37
+ if (current === "reject" || next === "reject") {
38
+ return "reject";
39
+ }
40
+ if (current === "warn" || next === "warn") {
41
+ return "warn";
42
+ }
43
+ return "ok";
44
+ }
45
+ function evaluateVersionCompatibility(input) {
46
+ const reasons = [];
47
+ let compatibility = "ok";
48
+ const clientProtocol = parseProtocolVersion(input.clientProtocolVersion);
49
+ const gatewayProtocol = parseProtocolVersion(input.gatewayProtocolVersion);
50
+ if (!gatewayProtocol) {
51
+ return {
52
+ compatibility: "reject",
53
+ reasons: ["Gateway protocol version is invalid."],
54
+ };
55
+ }
56
+ if (!clientProtocol) {
57
+ return {
58
+ compatibility: "reject",
59
+ reasons: ["Client protocol version is missing or invalid."],
60
+ };
61
+ }
62
+ if (clientProtocol.major !== gatewayProtocol.major) {
63
+ return {
64
+ compatibility: "reject",
65
+ reasons: [
66
+ `Protocol major mismatch: client ${input.clientProtocolVersion} vs gateway ${input.gatewayProtocolVersion}.`,
67
+ ],
68
+ };
69
+ }
70
+ if (clientProtocol.minor !== gatewayProtocol.minor) {
71
+ compatibility = mergeCompatibility(compatibility, "warn");
72
+ reasons.push(`Protocol minor mismatch: client ${input.clientProtocolVersion} vs gateway ${input.gatewayProtocolVersion}.`);
73
+ }
74
+ if (!input.clientPackageVersion?.trim()) {
75
+ compatibility = mergeCompatibility(compatibility, "warn");
76
+ reasons.push("Client package version is missing.");
77
+ }
78
+ else if (input.clientPackageVersion.trim() !== input.gatewayPackageVersion.trim()) {
79
+ compatibility = mergeCompatibility(compatibility, "warn");
80
+ reasons.push(`Package version mismatch: client ${input.clientPackageVersion.trim()} vs gateway ${input.gatewayPackageVersion.trim()}.`);
81
+ }
82
+ return { compatibility, reasons };
83
+ }
84
+ function findPackageRoot(startDir) {
85
+ let currentDir = node_path_1.default.resolve(startDir);
86
+ while (true) {
87
+ const packageJsonPath = node_path_1.default.join(currentDir, "package.json");
88
+ if ((0, node_fs_1.existsSync)(packageJsonPath)) {
89
+ try {
90
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, "utf8"));
91
+ if (parsed.name === "@deadragdoll/tellymcp") {
92
+ return currentDir;
93
+ }
94
+ }
95
+ catch {
96
+ // ignore malformed package.json while walking upward
97
+ }
98
+ }
99
+ const parentDir = node_path_1.default.dirname(currentDir);
100
+ if (parentDir === currentDir) {
101
+ return null;
102
+ }
103
+ currentDir = parentDir;
104
+ }
105
+ }
106
+ let cachedPackageVersion = null;
107
+ function getTellyMcpPackageVersion(startDir) {
108
+ if (cachedPackageVersion) {
109
+ return cachedPackageVersion;
110
+ }
111
+ const packageRoot = findPackageRoot(startDir);
112
+ if (!packageRoot) {
113
+ return "0.0.0-unknown";
114
+ }
115
+ try {
116
+ const packageJsonPath = node_path_1.default.join(packageRoot, "package.json");
117
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(packageJsonPath, "utf8"));
118
+ cachedPackageVersion = parsed.version?.trim() || "0.0.0-unknown";
119
+ return cachedPackageVersion;
120
+ }
121
+ catch {
122
+ return "0.0.0-unknown";
123
+ }
124
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_MCP_STANDALONE_HTTP_SERVICE_NAME = void 0;
4
+ const node_http_1 = require("node:http");
5
+ const mcp_http_service_1 = require("./mcp-http.service");
6
+ const runtime_service_1 = require("./runtime.service");
7
+ exports.TELEGRAM_MCP_STANDALONE_HTTP_SERVICE_NAME = "telegramMcp.standaloneHttp";
8
+ function resolveStandaloneBind(runtime) {
9
+ const mode = runtime.config.distributed.mode;
10
+ const publicRootPrefix = process.env.ROOT_PREFIX || "/api";
11
+ if (mode === "gateway" || mode === "both") {
12
+ const port = Number(process.env.PORT ?? runtime.config.mcp.httpPort);
13
+ return {
14
+ host: runtime.config.mcp.httpHost,
15
+ port,
16
+ publicRootPrefix,
17
+ };
18
+ }
19
+ return {
20
+ host: runtime.config.mcp.httpHost,
21
+ port: runtime.config.mcp.httpPort,
22
+ publicRootPrefix: "/",
23
+ };
24
+ }
25
+ const TelegramMcpStandaloneHttpService = {
26
+ name: exports.TELEGRAM_MCP_STANDALONE_HTTP_SERVICE_NAME,
27
+ dependencies: [
28
+ runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME,
29
+ mcp_http_service_1.TELEGRAM_MCP_HTTP_SERVICE_NAME,
30
+ ],
31
+ created() {
32
+ this.httpServer = null;
33
+ },
34
+ async started() {
35
+ if (process.env.TELLYMCP_STANDALONE_HTTP === "false") {
36
+ return;
37
+ }
38
+ await this.broker.waitForServices([
39
+ runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME,
40
+ mcp_http_service_1.TELEGRAM_MCP_HTTP_SERVICE_NAME,
41
+ ]);
42
+ const runtimeService = this.broker.getLocalService(runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME);
43
+ const httpService = this.broker.getLocalService(mcp_http_service_1.TELEGRAM_MCP_HTTP_SERVICE_NAME);
44
+ if (!runtimeService) {
45
+ throw new Error(`Local Moleculer service '${runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME}' is unavailable`);
46
+ }
47
+ if (!httpService?.routeRequest) {
48
+ throw new Error(`Local Moleculer service '${mcp_http_service_1.TELEGRAM_MCP_HTTP_SERVICE_NAME}' is unavailable`);
49
+ }
50
+ const runtime = runtimeService.getRuntime();
51
+ const { host, port, publicRootPrefix } = resolveStandaloneBind(runtime);
52
+ this.httpServer = (0, node_http_1.createServer)(async (req, res) => {
53
+ try {
54
+ const requestUrl = new URL(req.url ?? "/", "http://standalone.local");
55
+ await httpService.routeRequest?.(req, res, requestUrl.pathname);
56
+ }
57
+ catch (error) {
58
+ this.logger.error("Standalone HTTP request failed", {
59
+ error: error instanceof Error ? (error.stack ?? error.message) : String(error),
60
+ });
61
+ if (!res.headersSent) {
62
+ res.statusCode = 500;
63
+ res.setHeader("content-type", "text/plain; charset=utf-8");
64
+ }
65
+ if (!res.writableEnded) {
66
+ res.end("Internal Server Error");
67
+ }
68
+ }
69
+ });
70
+ await new Promise((resolve, reject) => {
71
+ const server = this.httpServer;
72
+ if (!server) {
73
+ reject(new Error("Standalone HTTP server was not created"));
74
+ return;
75
+ }
76
+ server.once("error", reject);
77
+ server.listen(port, host, () => {
78
+ server.off("error", reject);
79
+ resolve();
80
+ });
81
+ });
82
+ this.logger.info("telegram_mcp standalone HTTP server is ready", {
83
+ host,
84
+ port,
85
+ mode: runtime.config.distributed.mode,
86
+ rootPrefix: publicRootPrefix,
87
+ mcpPath: publicRootPrefix === "/"
88
+ ? runtime.config.mcp.httpPath
89
+ : `${publicRootPrefix}${runtime.config.mcp.httpPath}`,
90
+ webappBasePath: publicRootPrefix === "/"
91
+ ? runtime.config.webapp.basePath
92
+ : `${publicRootPrefix}${runtime.config.webapp.basePath}`,
93
+ gatewayPath: publicRootPrefix === "/" ? "/gateway" : `${publicRootPrefix}/gateway`,
94
+ });
95
+ },
96
+ async stopped() {
97
+ const server = this.httpServer;
98
+ this.httpServer = null;
99
+ if (!server) {
100
+ return;
101
+ }
102
+ await new Promise((resolve, reject) => {
103
+ server.close((error) => {
104
+ if (error) {
105
+ reject(error);
106
+ return;
107
+ }
108
+ resolve();
109
+ });
110
+ });
111
+ },
112
+ };
113
+ exports.default = TelegramMcpStandaloneHttpService;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TELEGRAM_MCP_TOOLS_SYNC_SERVICE_NAME = void 0;
4
+ const runtime_service_1 = require("./runtime.service");
5
+ const refreshToolsMarkdownService_1 = require("./src/features/tools-sync/model/refreshToolsMarkdownService");
6
+ exports.TELEGRAM_MCP_TOOLS_SYNC_SERVICE_NAME = "telegramMcp.toolsSync";
7
+ const TelegramMcpToolsSyncService = {
8
+ name: exports.TELEGRAM_MCP_TOOLS_SYNC_SERVICE_NAME,
9
+ dependencies: [runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME],
10
+ created() {
11
+ this.refreshToolsMarkdownService = null;
12
+ },
13
+ methods: {
14
+ getRefreshToolsMarkdownService() {
15
+ if (!this.refreshToolsMarkdownService) {
16
+ throw new Error("telegram_mcp tools sync service is not initialized yet");
17
+ }
18
+ return this.refreshToolsMarkdownService;
19
+ },
20
+ },
21
+ async started() {
22
+ await this.broker.waitForServices([runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME]);
23
+ const runtimeService = this.broker.getLocalService(runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME);
24
+ if (!runtimeService) {
25
+ throw new Error(`Local Moleculer service '${runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME}' is unavailable`);
26
+ }
27
+ const runtime = runtimeService.getRuntime();
28
+ this.logger.info("Starting telegram_mcp tools sync service");
29
+ this.refreshToolsMarkdownService = new refreshToolsMarkdownService_1.RefreshToolsMarkdownService(runtime.config, runtime.stateStore, runtime.logger, runtime.projectIdentityResolver);
30
+ this.logger.info("telegram_mcp tools sync service is ready");
31
+ },
32
+ };
33
+ exports.default = TelegramMcpToolsSyncService;
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "@deadragdoll/tellymcp",
3
+ "version": "0.0.1",
4
+ "description": "TellyMCP - Telegram Human-in-the-Loop MCP Server",
5
+ "main": "dist/services/features/telegram-mcp/runtime.service.js",
6
+ "bin": {
7
+ "tellymcp": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "scripts",
12
+ "config/templates",
13
+ "README.md",
14
+ "README-ru.md",
15
+ "STANDALONE.md",
16
+ "STANDALONE-ru.md",
17
+ "CHANGELOG.md",
18
+ "TOOLS.md",
19
+ ".env.example.client",
20
+ ".env.example.gateway"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "keywords": [
26
+ "telegram",
27
+ "mcp",
28
+ "human-in-the-loop",
29
+ "bot",
30
+ "agent"
31
+ ],
32
+ "_moduleAliases": {
33
+ "@src": "src"
34
+ },
35
+ "scripts": {
36
+ "postinstall": "node ./scripts/postinstall.js",
37
+ "mcp:local": "codex mcp add telegramHuman --url http://127.0.0.1:8787/mcp",
38
+ "dev:gw": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_EXPERIMENTAL_RESOLVER=1 NODE_OPTIONS=--openssl-legacy-provider ts-node ./node_modules/moleculer/bin/moleculer-runner.js src/services --config src/moleculer.config.ts --envfile ./.env-dev --hot --mask \"**/*.service.ts\"",
39
+ "dev:builder": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_EXPERIMENTAL_RESOLVER=1 NODE_OPTIONS=--openssl-legacy-provider ts-node ./node_modules/moleculer/bin/moleculer-runner.js src/services --config src/moleculer.config.ts --envfile ./.env-builder --hot --mask \"**/*.service.ts\"",
40
+ "dev:gw:telegram": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_EXPERIMENTAL_RESOLVER=1 NODE_OPTIONS=--openssl-legacy-provider ts-node ./node_modules/moleculer/bin/moleculer-runner.js src/services/features/telegram-mcp --config src/moleculer.config.ts --envfile ./.env-dev --hot --mask \"**/*.service.ts\"",
41
+ "dev:client": "TS_NODE_TRANSPILE_ONLY=1 TS_NODE_EXPERIMENTAL_RESOLVER=1 NODE_OPTIONS=--openssl-legacy-provider ts-node ./node_modules/moleculer/bin/moleculer-runner.js src/services --config src/moleculer.config.ts --envfile ./.env-client --hot --mask \"**/*.service.ts\"",
42
+ "dev": "yarn dev:gw",
43
+ "dev:watch": "yarn dev:gw",
44
+ "dev:service": "yarn dev:gw",
45
+ "build": "rm -rf dist && tsc -p tsconfig.json && tsc-alias -p tsconfig.json",
46
+ "start": "yarn start:gw",
47
+ "start:gw": "node ./node_modules/moleculer/bin/moleculer-runner.js dist/services --config dist/moleculer.config.js --mask \"**/*.service.js\"",
48
+ "start:gw:telegram": "node ./node_modules/moleculer/bin/moleculer-runner.js dist/services/features/telegram-mcp --config dist/moleculer.config.js --mask \"**/*.service.js\"",
49
+ "lint": "eslint .",
50
+ "format": "prettier --write .",
51
+ "format:check": "prettier --check .",
52
+ "test": "vitest run",
53
+ "test:watch": "vitest"
54
+ },
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "git+https://github.com/code4bones/tellymcp.git"
58
+ },
59
+ "homepage": "https://www.npmjs.com/package/@deadragdoll/tellymcp",
60
+ "bugs": {
61
+ "url": "https://github.com/code4bones/tellymcp/issues"
62
+ },
63
+ "author": "code4bones <code4bones@gmail.com>",
64
+ "license": "MIT",
65
+ "engines": {
66
+ "node": ">=24.0.0"
67
+ },
68
+ "dependencies": {
69
+ "@grammyjs/menu": "^1.3.1",
70
+ "@grammyjs/storage-redis": "^2.5.1",
71
+ "@modelcontextprotocol/sdk": "^1.18.1",
72
+ "amqplib": "0.10.9",
73
+ "dotenv": "^17.4.2",
74
+ "grammy": "1.43.0",
75
+ "graphql": "^16.14.0",
76
+ "https-proxy-agent": "^7.0.6",
77
+ "ioredis": "5.10.1",
78
+ "knex": "^3.2.10",
79
+ "mime-types": "^3.0.2",
80
+ "module-alias": "^2.3.4",
81
+ "moleculer": "0.15.0",
82
+ "node-fetch": "^3.3.2",
83
+ "pg": "^8.20.0",
84
+ "picocolors": "^1.1.1",
85
+ "pino": "^10.3.1",
86
+ "pino-pretty": "^13.1.3",
87
+ "playwright": "^1.60.0",
88
+ "redis": "5.12.1",
89
+ "socks-proxy-agent": "^8.0.5",
90
+ "ws": "8.20.1",
91
+ "zod": "4.4.3"
92
+ },
93
+ "devDependencies": {
94
+ "@eslint/js": "^9.34.0",
95
+ "@types/amqplib": "^0.10.8",
96
+ "@types/mime-types": "^3.0.1",
97
+ "@types/node": "24.12.4",
98
+ "eslint": "^9.34.0",
99
+ "eslint-import-resolver-typescript": "^4.4.4",
100
+ "eslint-plugin-import": "^2.32.0",
101
+ "globals": "^16.3.0",
102
+ "prettier": "^3.6.2",
103
+ "ts-node": "^10.9.2",
104
+ "tsc-alias": "^1.8.17",
105
+ "tsx": "4.22.1",
106
+ "typescript": "^5.9.2",
107
+ "typescript-eslint": "8.59.3",
108
+ "vitest": "^4.1.6"
109
+ }
110
+ }
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ const { spawnSync } = require("node:child_process");
4
+ const pc = require("picocolors");
5
+
6
+ function getTmuxStatus() {
7
+ const result = spawnSync("tmux", ["-V"], {
8
+ encoding: "utf8",
9
+ stdio: ["ignore", "pipe", "ignore"],
10
+ });
11
+
12
+ if (result.status === 0) {
13
+ return {
14
+ found: true,
15
+ version: (result.stdout || "tmux").trim(),
16
+ };
17
+ }
18
+
19
+ return { found: false };
20
+ }
21
+
22
+ function getInstallHints() {
23
+ if (process.platform === "darwin") {
24
+ return ["brew install tmux"];
25
+ }
26
+
27
+ return [
28
+ "Ubuntu/Debian: sudo apt install tmux",
29
+ "Fedora/RHEL: sudo dnf install tmux",
30
+ "Arch: sudo pacman -S tmux",
31
+ ];
32
+ }
33
+
34
+ function line(value = "") {
35
+ process.stdout.write(`${value}\n`);
36
+ }
37
+
38
+ const tmux = getTmuxStatus();
39
+
40
+ line();
41
+ line(`${pc.bold(pc.cyan("TellyMCP"))} ${pc.dim("installed")}`);
42
+ line();
43
+
44
+ if (tmux.found) {
45
+ line(`${pc.green("OK")} tmux detected: ${tmux.version}`);
46
+ line("Live view and session nudges should work on this machine.");
47
+ } else {
48
+ line(`${pc.yellow("WARN")} tmux was not found on this system.`);
49
+ line("TellyMCP can still run, but Live view and nudges will be limited.");
50
+ line("Install tmux, for example:");
51
+ for (const hint of getInstallHints()) {
52
+ line(` ${hint}`);
53
+ }
54
+ }
55
+
56
+ line();
57
+ line(`Check your local setup: ${pc.bold("tellymcp doctor")}`);
58
+ line(`General help: ${pc.bold("tellymcp help")}`);
59
+ line(`MCP setup examples: ${pc.bold("tellymcp mcp --help")}`);
60
+ line();