@deadragdoll/tellymcp 0.0.10 → 0.0.12
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/.env.example.client +42 -52
- package/.env.example.gateway +48 -62
- package/CHANGELOG.md +3 -3
- package/README-ru.md +226 -376
- package/README.md +213 -1184
- package/TOOLS.md +320 -377
- package/VERSION.md +13 -13
- package/config/codex/plugins/telly-workflows/.codex-plugin/plugin.json +18 -0
- package/config/codex/plugins/telly-workflows/references/invariants.md +10 -0
- package/config/codex/plugins/telly-workflows/skills/telly-browser-screenshot/SKILL.md +27 -0
- package/config/codex/plugins/telly-workflows/skills/telly-collab-artifact/SKILL.md +22 -0
- package/config/codex/plugins/telly-workflows/skills/telly-human-telegram/SKILL.md +31 -0
- package/config/codex/plugins/telly-workflows/skills/telly-partner-note/SKILL.md +36 -0
- package/config/templates/env.both.template +39 -20
- package/config/templates/env.client.template +34 -19
- package/config/templates/env.gateway.template +37 -22
- package/dist/cli.js +322 -75
- package/dist/codexPluginInstaller.js +215 -0
- package/dist/lib/mixins/session.errors.js +34 -1
- package/dist/lib/pinoTargets.js +2 -2
- package/dist/moleculer.config.js +7 -5
- package/dist/services/features/telegram-mcp/browser.service.js +94 -1
- package/dist/services/features/telegram-mcp/collaboration.service.js +40 -3
- package/dist/services/features/telegram-mcp/ensuredb.service.js +145 -26
- package/dist/services/features/telegram-mcp/gateway-delivery.service.js +285 -103
- package/dist/services/features/telegram-mcp/gateway-socket.service.js +907 -85
- package/dist/services/features/telegram-mcp/gateway.service.js +876 -81
- package/dist/services/features/telegram-mcp/mcp-http.service.js +8 -0
- package/dist/services/features/telegram-mcp/mcp-server.service.js +17 -26
- package/dist/services/features/telegram-mcp/notify.service.js +127 -1
- package/dist/services/features/telegram-mcp/session-context.service.js +28 -1
- package/dist/services/features/telegram-mcp/src/app/bootstrap/runtime.js +132 -10
- package/dist/services/features/telegram-mcp/src/app/config/env.js +158 -52
- package/dist/services/features/telegram-mcp/src/app/http.js +375 -42
- package/dist/services/features/telegram-mcp/src/app/webapp/assets.js +386 -58
- package/dist/services/features/telegram-mcp/src/app/webapp/auth.js +3 -0
- package/dist/services/features/telegram-mcp/src/app/webapp/terminal.js +12 -0
- package/dist/services/features/telegram-mcp/src/entities/request/model/schema.js +120 -104
- package/dist/services/features/telegram-mcp/src/entities/xchange/model/types.js +2 -0
- package/dist/services/features/telegram-mcp/src/features/ask-user/model/askUserTelegram.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/browser/model/browserOpenTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/browser/model/browserScreenshotTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/browser/model/browserService.js +306 -26
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/gatewaySessionsService.js +71 -0
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/listGatewaySessionsTool.js +33 -0
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/localCollaborationBackend.js +93 -82
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileService.js +47 -5
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerNoteTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayClientAccess.js +82 -0
- package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayCollaborationBackend.js +22 -14
- package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayHttpService.js +697 -75
- package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/remoteConsoleActionClient.js +76 -0
- package/dist/services/features/telegram-mcp/src/features/embedded-runtime/model/embeddedRuntimeBroker.js +92 -0
- package/dist/services/features/telegram-mcp/src/features/foreground-terminal/model/foregroundTerminalRuntime.js +192 -0
- package/dist/services/features/telegram-mcp/src/features/notify/model/notifyService.js +382 -3
- package/dist/services/features/telegram-mcp/src/features/notify/model/notifyTelegramTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/notify/model/sendFileToTelegramTool.js +33 -0
- package/dist/services/features/telegram-mcp/src/features/session-context/model/clearSessionContextTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/session-context/model/getSessionContextTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/session-context/model/renameSessionTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/session-context/model/sessionContextService.js +42 -200
- package/dist/services/features/telegram-mcp/src/features/session-context/model/setSessionContextTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/terminal-buffer/model/terminalBufferService.js +96 -0
- package/dist/services/features/telegram-mcp/src/features/terminal-input/model/terminalInputService.js +97 -0
- package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownService.js +107 -58
- package/dist/services/features/telegram-mcp/src/features/tools-sync/model/refreshToolsMarkdownTool.js +1 -1
- package/dist/services/features/telegram-mcp/src/features/xchange/model/getXchangeRecordTool.js +28 -0
- package/dist/services/features/telegram-mcp/src/features/xchange/model/listXchangeRecordsTool.js +28 -0
- package/dist/services/features/telegram-mcp/src/features/xchange/model/markXchangeRecordReadTool.js +28 -0
- package/dist/services/features/telegram-mcp/src/features/xchange/model/xchangeService.js +169 -0
- package/dist/services/features/telegram-mcp/src/processes/human-approval/model/orchestrator.js +5 -4
- package/dist/services/features/telegram-mcp/src/shared/i18n/resources/en.js +143 -42
- package/dist/services/features/telegram-mcp/src/shared/i18n/resources/ru.js +139 -38
- package/dist/services/features/telegram-mcp/src/shared/integrations/memory/processLocalSessionStore.js +27 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/object-storage/minioExchangeStore.js +11 -8
- package/dist/services/features/telegram-mcp/src/shared/integrations/redis/stateStore.js +69 -70
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/proxyFetch.js +21 -22
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transport.js +444 -7093
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportAttachmentStore.js +93 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportBroadcastActions.js +385 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportConsoleRegistry.js +149 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportConstructorWiring.js +642 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportContent.js +84 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportContext.js +78 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportDocumentActions.js +36 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportEventActions.js +292 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportFileHandoffActions.js +352 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportFormatting.js +75 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportGatewayActions.js +44 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportLifecycleActions.js +161 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportLive.js +56 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportLiveActions.js +77 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuCallbacks.js +254 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuFactories.js +538 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuFingerprints.js +93 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuFlow.js +344 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuShell.js +65 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuState.js +408 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMenuText.js +216 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMessageFlow.js +452 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportOutputActions.js +189 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportPartnerActions.js +286 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportPayloadState.js +108 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectActions.js +463 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectEntryActions.js +202 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectEvents.js +99 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectMenus.js +138 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectState.js +308 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectView.js +426 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportRequestFlow.js +278 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportSessionActions.js +143 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportTerminalActions.js +665 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportTerminalRuntime.js +226 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportTypes.js +2 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportUtils.js +330 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportXchangeState.js +107 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/client.js +255 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/ptyRegistry.js +543 -0
- package/dist/services/features/telegram-mcp/src/shared/integrations/xchange/sqliteRecordStore.js +223 -0
- package/dist/services/features/telegram-mcp/src/shared/lib/gatewayScope.js +24 -0
- package/dist/services/features/telegram-mcp/src/shared/lib/logger/logger.js +6 -0
- package/dist/services/features/telegram-mcp/src/shared/lib/project-identity/projectIdentity.js +147 -76
- package/dist/services/features/telegram-mcp/src/shared/lib/telegramXchangeRecords.js +72 -0
- package/dist/services/features/telegram-mcp/src/shared/lib/terminalPromptDetection.js +409 -0
- package/dist/services/features/telegram-mcp/src/shared/lib/version/versionHandshake.js +129 -1
- package/dist/services/features/telegram-mcp/src/shared/lib/xchangeRecordHints.js +98 -0
- package/dist/services/features/telegram-mcp/standalone-http.service.js +12 -0
- package/dist/services/features/telegram-mcp/terminal-buffer.service.js +42 -0
- package/dist/services/features/telegram-mcp/terminal-input.service.js +41 -0
- package/dist/services/features/telegram-mcp/tools-sync.service.js +15 -1
- package/dist/services/features/telegram-mcp/xchange.service.js +123 -0
- package/docs/STANDALONE-ru.md +172 -0
- package/docs/STANDALONE.md +172 -0
- package/package.json +10 -5
- package/scripts/build-package-artifact.sh +27 -0
- package/scripts/deploy-gateway.sh +64 -0
- package/scripts/deploy-onebot-branch.sh +27 -0
- package/scripts/postinstall.js +11 -36
- package/STANDALONE-ru.md +0 -274
- package/STANDALONE.md +0 -274
- package/dist/services/features/telegram-mcp/inbox.service.js +0 -33
- package/dist/services/features/telegram-mcp/pair.service.js +0 -33
- package/dist/services/features/telegram-mcp/src/app/webapp/tmux.js +0 -10
- package/dist/services/features/telegram-mcp/src/features/inbox/model/deleteTelegramInboxMessageTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxCountTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/inbox/model/inboxService.js +0 -77
- package/dist/services/features/telegram-mcp/src/features/pair-session/model/clearSessionPairingTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/pair-session/model/createSessionPairCodeTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/pair-session/model/generatePairCode.js +0 -202
- package/dist/services/features/telegram-mcp/src/features/session-context/model/getTmuxTargetTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/features/session-context/model/setTmuxTargetTool.js +0 -33
- package/dist/services/features/telegram-mcp/src/shared/integrations/tmux/client.js +0 -363
package/STANDALONE.md
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
# TellyMCP Standalone Guide
|
|
2
|
-
|
|
3
|
-
[English](STANDALONE.md) | [Русский](STANDALONE-ru.md)
|
|
4
|
-
|
|
5
|
-
This guide explains the simplest TellyMCP setup:
|
|
6
|
-
|
|
7
|
-
- one machine
|
|
8
|
-
- one Telegram bot
|
|
9
|
-
- no shared gateway
|
|
10
|
-
- no Postgres
|
|
11
|
-
- no RabbitMQ
|
|
12
|
-
|
|
13
|
-
This is the best way to start.
|
|
14
|
-
|
|
15
|
-
## What you need
|
|
16
|
-
|
|
17
|
-
Before installation, make sure you have:
|
|
18
|
-
|
|
19
|
-
1. Node.js 24+
|
|
20
|
-
2. `tmux`
|
|
21
|
-
3. Redis
|
|
22
|
-
4. a Telegram bot token from BotFather
|
|
23
|
-
5. optional for `browser_*` tools: Playwright Chromium browser binaries
|
|
24
|
-
|
|
25
|
-
Why these matter:
|
|
26
|
-
|
|
27
|
-
- Node.js runs the service
|
|
28
|
-
- `tmux` enables Live View, nudges, and direct Telegram-side interaction
|
|
29
|
-
- Redis stores session state, inbox, pairing state, and menu state
|
|
30
|
-
- Telegram bot token connects your bot to Telegram
|
|
31
|
-
|
|
32
|
-
## Step 1. Install prerequisites
|
|
33
|
-
|
|
34
|
-
Ubuntu / Debian example:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
sudo apt-get update
|
|
38
|
-
sudo apt-get install -y tmux redis-server
|
|
39
|
-
node -v
|
|
40
|
-
tmux -V
|
|
41
|
-
redis-cli ping
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Expected:
|
|
45
|
-
|
|
46
|
-
- Node version is `24.x` or newer
|
|
47
|
-
- `tmux -V` prints a version
|
|
48
|
-
- `redis-cli ping` returns `PONG`
|
|
49
|
-
|
|
50
|
-
If you plan to use browser automation tools later, also run:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
tellymcp browser install
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
## Step 2. Create a Telegram bot
|
|
57
|
-
|
|
58
|
-
In Telegram:
|
|
59
|
-
|
|
60
|
-
1. Open BotFather
|
|
61
|
-
2. Run `/newbot`
|
|
62
|
-
3. Choose a bot name
|
|
63
|
-
4. Choose a bot username
|
|
64
|
-
5. Save the token
|
|
65
|
-
|
|
66
|
-
You will need:
|
|
67
|
-
|
|
68
|
-
- `TELEGRAM_BOT_TOKEN`
|
|
69
|
-
- `TELEGRAM_BOT_USERNAME`
|
|
70
|
-
|
|
71
|
-
## Step 3. Install TellyMCP
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npm install -g @deadragdoll/tellymcp
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Check that the CLI works:
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
tellymcp help
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
## Step 4. Start a tmux session for the agent
|
|
84
|
-
|
|
85
|
-
This part is important.
|
|
86
|
-
|
|
87
|
-
Run the agent inside `tmux`, not in a plain shell, if you want the full experience.
|
|
88
|
-
|
|
89
|
-
Create a session:
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
tmux new -s backend
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
Good session names:
|
|
96
|
-
|
|
97
|
-
- `backend`
|
|
98
|
-
- `frontend`
|
|
99
|
-
- `review`
|
|
100
|
-
- `ops`
|
|
101
|
-
|
|
102
|
-
Why the session name matters:
|
|
103
|
-
|
|
104
|
-
- it helps identify the agent in practice
|
|
105
|
-
- it improves diagnostics
|
|
106
|
-
- it makes Telegram and Live View easier to understand
|
|
107
|
-
|
|
108
|
-
If you later detach:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
tmux detach
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
and return:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
tmux attach -t backend
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Step 5. Create the standalone config
|
|
121
|
-
|
|
122
|
-
Inside the workspace where you want to run TellyMCP:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
tellymcp init client
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
This creates a local `.env`.
|
|
129
|
-
|
|
130
|
-
## Step 6. Fill `.env`
|
|
131
|
-
|
|
132
|
-
At minimum, set:
|
|
133
|
-
|
|
134
|
-
```env
|
|
135
|
-
TELEGRAM_BOT_TOKEN=...
|
|
136
|
-
TELEGRAM_BOT_USERNAME=@your_bot
|
|
137
|
-
REDIS_HOST=127.0.0.1
|
|
138
|
-
REDIS_PORT=6379
|
|
139
|
-
REDIS_DB=1
|
|
140
|
-
MCP_HTTP_HOST=127.0.0.1
|
|
141
|
-
MCP_HTTP_PORT=8787
|
|
142
|
-
MCP_HTTP_PATH=/mcp
|
|
143
|
-
MCP_HTTP_BEARER_TOKEN=choose-a-secret-token
|
|
144
|
-
DISTRIBUTED_MODE=client
|
|
145
|
-
WEBAPP_ENABLED=true
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
If your tmux server uses a non-default socket:
|
|
149
|
-
|
|
150
|
-
```env
|
|
151
|
-
TMUX_SOCKET_PATH=/tmp/tmux-1000/default
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Step 7. Validate the setup
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
tellymcp doctor --env .env
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
In standalone `client` mode it should verify:
|
|
161
|
-
|
|
162
|
-
- `tmux`
|
|
163
|
-
- `.env`
|
|
164
|
-
- Redis
|
|
165
|
-
- local MCP bind
|
|
166
|
-
- Playwright Chromium when browser tools are enabled
|
|
167
|
-
|
|
168
|
-
## Step 8. Run the service
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
tellymcp run --env .env
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Standalone MCP endpoint is normally:
|
|
175
|
-
|
|
176
|
-
- `http://127.0.0.1:8787/mcp`
|
|
177
|
-
|
|
178
|
-
## Step 9. Add MCP to your agent
|
|
179
|
-
|
|
180
|
-
To get a ready-to-paste config snippet:
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
tellymcp mcp --help
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
Typical local MCP config target:
|
|
187
|
-
|
|
188
|
-
- `http://127.0.0.1:8787/mcp`
|
|
189
|
-
|
|
190
|
-
If you use bearer auth, configure your agent with the same token from `.env`.
|
|
191
|
-
|
|
192
|
-
## Step 10. Pair the agent with Telegram
|
|
193
|
-
|
|
194
|
-
Once MCP is connected, tell the agent something like:
|
|
195
|
-
|
|
196
|
-
- `pair with Telegram`
|
|
197
|
-
- `link to Telegram`
|
|
198
|
-
- `connect this session to Telegram`
|
|
199
|
-
- `create a Telegram pairing code`
|
|
200
|
-
|
|
201
|
-
Expected flow:
|
|
202
|
-
|
|
203
|
-
1. the agent calls `create_session_pair_code`
|
|
204
|
-
2. it gives you a short code
|
|
205
|
-
3. you send `/start <code>` or `/link <code>` to the bot
|
|
206
|
-
4. after success, open `/menu`
|
|
207
|
-
|
|
208
|
-
If the agent is running inside `tmux`, it should pass:
|
|
209
|
-
|
|
210
|
-
- `cwd`
|
|
211
|
-
- tmux session name
|
|
212
|
-
- tmux window/pane attributes
|
|
213
|
-
|
|
214
|
-
This lets Live View and tmux nudges work immediately.
|
|
215
|
-
|
|
216
|
-
## Step 11. What you get after pairing
|
|
217
|
-
|
|
218
|
-
After pairing, Telegram can be used for:
|
|
219
|
-
|
|
220
|
-
- inbox messages
|
|
221
|
-
- clarifying questions
|
|
222
|
-
- local partner collaboration
|
|
223
|
-
- session switching
|
|
224
|
-
- storage inspection
|
|
225
|
-
- Live View
|
|
226
|
-
|
|
227
|
-
The agent can:
|
|
228
|
-
|
|
229
|
-
- call `ask_user_telegram`
|
|
230
|
-
- read unsolicited inbox messages
|
|
231
|
-
- send notes and files
|
|
232
|
-
- receive tmux nudges when new work arrives
|
|
233
|
-
|
|
234
|
-
## What works without tmux
|
|
235
|
-
|
|
236
|
-
TellyMCP can still run without `tmux`, but this is a reduced mode.
|
|
237
|
-
|
|
238
|
-
You lose:
|
|
239
|
-
|
|
240
|
-
- Live View
|
|
241
|
-
- tmux nudges
|
|
242
|
-
- direct Telegram Mini App controls
|
|
243
|
-
|
|
244
|
-
Use this only if you accept a passive workflow.
|
|
245
|
-
|
|
246
|
-
## Troubleshooting
|
|
247
|
-
|
|
248
|
-
If `doctor` fails:
|
|
249
|
-
|
|
250
|
-
- verify Redis is running
|
|
251
|
-
- verify `tmux` is installed
|
|
252
|
-
- verify the bot token is correct
|
|
253
|
-
- verify your bearer token matches the MCP client config
|
|
254
|
-
|
|
255
|
-
If pairing works but Live View does not:
|
|
256
|
-
|
|
257
|
-
- make sure the agent is really inside `tmux`
|
|
258
|
-
- make sure the tmux session has a stable name
|
|
259
|
-
- if needed, set `TMUX_SOCKET_PATH`
|
|
260
|
-
|
|
261
|
-
If the agent cannot connect to MCP:
|
|
262
|
-
|
|
263
|
-
- confirm `tellymcp run --env .env` is running
|
|
264
|
-
- confirm the endpoint is `http://127.0.0.1:8787/mcp`
|
|
265
|
-
- confirm the bearer token matches
|
|
266
|
-
|
|
267
|
-
## Next step
|
|
268
|
-
|
|
269
|
-
After standalone is working, the next upgrade path is:
|
|
270
|
-
|
|
271
|
-
- `gateway`
|
|
272
|
-
- or `both`
|
|
273
|
-
|
|
274
|
-
Use that only when you need cross-machine collaboration.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TELEGRAM_MCP_INBOX_SERVICE_NAME = void 0;
|
|
4
|
-
const runtime_service_1 = require("./runtime.service");
|
|
5
|
-
const inboxService_1 = require("./src/features/inbox/model/inboxService");
|
|
6
|
-
exports.TELEGRAM_MCP_INBOX_SERVICE_NAME = "telegramMcp.inbox";
|
|
7
|
-
const TelegramMcpInboxService = {
|
|
8
|
-
name: exports.TELEGRAM_MCP_INBOX_SERVICE_NAME,
|
|
9
|
-
dependencies: [runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME],
|
|
10
|
-
created() {
|
|
11
|
-
this.inboxService = null;
|
|
12
|
-
},
|
|
13
|
-
methods: {
|
|
14
|
-
getInboxService() {
|
|
15
|
-
if (!this.inboxService) {
|
|
16
|
-
throw new Error("telegram_mcp inbox service is not initialized yet");
|
|
17
|
-
}
|
|
18
|
-
return this.inboxService;
|
|
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 = await runtimeService.waitUntilReady();
|
|
28
|
-
this.logger.info("Starting telegram_mcp inbox service");
|
|
29
|
-
this.inboxService = new inboxService_1.InboxService(runtime.config, runtime.stateStore, runtime.stateStore, runtime.logger, runtime.projectIdentityResolver);
|
|
30
|
-
this.logger.info("telegram_mcp inbox service is ready");
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
exports.default = TelegramMcpInboxService;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TELEGRAM_MCP_PAIR_SERVICE_NAME = void 0;
|
|
4
|
-
const runtime_service_1 = require("./runtime.service");
|
|
5
|
-
const generatePairCode_1 = require("./src/features/pair-session/model/generatePairCode");
|
|
6
|
-
exports.TELEGRAM_MCP_PAIR_SERVICE_NAME = "telegramMcp.pair";
|
|
7
|
-
const TelegramMcpPairService = {
|
|
8
|
-
name: exports.TELEGRAM_MCP_PAIR_SERVICE_NAME,
|
|
9
|
-
dependencies: [runtime_service_1.TELEGRAM_MCP_RUNTIME_SERVICE_NAME],
|
|
10
|
-
created() {
|
|
11
|
-
this.pairSessionService = null;
|
|
12
|
-
},
|
|
13
|
-
methods: {
|
|
14
|
-
getPairSessionService() {
|
|
15
|
-
if (!this.pairSessionService) {
|
|
16
|
-
throw new Error("telegram_mcp pair service is not initialized yet");
|
|
17
|
-
}
|
|
18
|
-
return this.pairSessionService;
|
|
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 = await runtimeService.waitUntilReady();
|
|
28
|
-
this.logger.info("Starting telegram_mcp pair service");
|
|
29
|
-
this.pairSessionService = new generatePairCode_1.PairSessionService(runtime.config, runtime.stateStore, runtime.stateStore, runtime.stateStore, runtime.logger, runtime.projectIdentityResolver);
|
|
30
|
-
this.logger.info("telegram_mcp pair service is ready");
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
exports.default = TelegramMcpPairService;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sendTmuxLiteralText = exports.sendAllowedTmuxAction = exports.isTmuxUnavailableError = exports.getTmuxWindowHeight = exports.captureVisibleTmuxPane = exports.captureTmuxPaneRange = void 0;
|
|
4
|
-
var client_1 = require("../../shared/integrations/tmux/client");
|
|
5
|
-
Object.defineProperty(exports, "captureTmuxPaneRange", { enumerable: true, get: function () { return client_1.captureTmuxPaneRange; } });
|
|
6
|
-
Object.defineProperty(exports, "captureVisibleTmuxPane", { enumerable: true, get: function () { return client_1.captureVisibleTmuxPane; } });
|
|
7
|
-
Object.defineProperty(exports, "getTmuxWindowHeight", { enumerable: true, get: function () { return client_1.getTmuxWindowHeight; } });
|
|
8
|
-
Object.defineProperty(exports, "isTmuxUnavailableError", { enumerable: true, get: function () { return client_1.isTmuxUnavailableError; } });
|
|
9
|
-
Object.defineProperty(exports, "sendAllowedTmuxAction", { enumerable: true, get: function () { return client_1.sendAllowedTmuxAction; } });
|
|
10
|
-
Object.defineProperty(exports, "sendTmuxLiteralText", { enumerable: true, get: function () { return client_1.sendTmuxLiteralText; } });
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteTelegramInboxMessageTool = void 0;
|
|
4
|
-
const schema_1 = require("../../../entities/request/model/schema");
|
|
5
|
-
function createContent(output) {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
type: "text",
|
|
9
|
-
text: JSON.stringify(output, null, 2),
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
class DeleteTelegramInboxMessageTool {
|
|
14
|
-
inboxService;
|
|
15
|
-
constructor(inboxService) {
|
|
16
|
-
this.inboxService = inboxService;
|
|
17
|
-
}
|
|
18
|
-
register(server) {
|
|
19
|
-
server.registerTool("delete_telegram_inbox_message", {
|
|
20
|
-
title: "Delete Telegram Inbox Message",
|
|
21
|
-
description: "Use this only after you have fully processed an ordinary human Telegram inbox message. Pass session_id explicitly after pairing; do not rely on implicit defaults unless cwd is also correct for this agent workspace. Delete the message so future inbox reads do not return it again.",
|
|
22
|
-
inputSchema: schema_1.deleteTelegramInboxMessageInputSchema,
|
|
23
|
-
outputSchema: schema_1.deleteTelegramInboxMessageOutputSchema,
|
|
24
|
-
}, async (args) => {
|
|
25
|
-
const output = await this.inboxService.deleteInboxMessage(args);
|
|
26
|
-
return {
|
|
27
|
-
content: createContent(output),
|
|
28
|
-
structuredContent: output,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.DeleteTelegramInboxMessageTool = DeleteTelegramInboxMessageTool;
|
package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxCountTool.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetTelegramInboxCountTool = void 0;
|
|
4
|
-
const schema_1 = require("../../../entities/request/model/schema");
|
|
5
|
-
function createContent(output) {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
type: "text",
|
|
9
|
-
text: JSON.stringify(output, null, 2),
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
class GetTelegramInboxCountTool {
|
|
14
|
-
inboxService;
|
|
15
|
-
constructor(inboxService) {
|
|
16
|
-
this.inboxService = inboxService;
|
|
17
|
-
}
|
|
18
|
-
register(server) {
|
|
19
|
-
server.registerTool("get_telegram_inbox_count", {
|
|
20
|
-
title: "Get Telegram Inbox Count",
|
|
21
|
-
description: "Use this to cheaply check whether ordinary human Telegram messages are waiting for the session. Pass session_id explicitly after pairing; do not rely on implicit defaults unless cwd is also correct for this agent workspace. Do not use it for partner-note wakeups; partner notes must be read from .mcp-xchange/SHARED_INDEX.md instead.",
|
|
22
|
-
inputSchema: schema_1.getTelegramInboxCountInputSchema,
|
|
23
|
-
outputSchema: schema_1.getTelegramInboxCountOutputSchema,
|
|
24
|
-
}, async (args) => {
|
|
25
|
-
const output = await this.inboxService.getInboxCount(args);
|
|
26
|
-
return {
|
|
27
|
-
content: createContent(output),
|
|
28
|
-
structuredContent: output,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.GetTelegramInboxCountTool = GetTelegramInboxCountTool;
|
package/dist/services/features/telegram-mcp/src/features/inbox/model/getTelegramInboxTool.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetTelegramInboxTool = void 0;
|
|
4
|
-
const schema_1 = require("../../../entities/request/model/schema");
|
|
5
|
-
function createContent(output) {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
type: "text",
|
|
9
|
-
text: JSON.stringify(output, null, 2),
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
class GetTelegramInboxTool {
|
|
14
|
-
inboxService;
|
|
15
|
-
constructor(inboxService) {
|
|
16
|
-
this.inboxService = inboxService;
|
|
17
|
-
}
|
|
18
|
-
register(server) {
|
|
19
|
-
server.registerTool("get_telegram_inbox", {
|
|
20
|
-
title: "Get Telegram Inbox",
|
|
21
|
-
description: "Use this to read unsolicited Telegram inbox messages stored for the session. Pass session_id explicitly after pairing; do not rely on implicit defaults unless cwd is also correct for this agent workspace. Each item now includes message_kind: human or system. Treat system messages as operational instructions from the service, not as normal user prompts. Returned items may also include local attachment paths from .mcp-xchange when the human message contained a photo or document. Do not use this first for partner-note wakeups; partner collaboration notes must be read from .mcp-xchange/SHARED_INDEX.md and the referenced note files.",
|
|
22
|
-
inputSchema: schema_1.getTelegramInboxInputSchema,
|
|
23
|
-
outputSchema: schema_1.getTelegramInboxOutputSchema,
|
|
24
|
-
}, async (args) => {
|
|
25
|
-
const output = await this.inboxService.getInbox(args);
|
|
26
|
-
return {
|
|
27
|
-
content: createContent(output),
|
|
28
|
-
structuredContent: output,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.GetTelegramInboxTool = GetTelegramInboxTool;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InboxService = void 0;
|
|
4
|
-
class InboxService {
|
|
5
|
-
config;
|
|
6
|
-
inboxStore;
|
|
7
|
-
_sessionStore;
|
|
8
|
-
logger;
|
|
9
|
-
projectIdentityResolver;
|
|
10
|
-
constructor(config, inboxStore, _sessionStore, logger, projectIdentityResolver) {
|
|
11
|
-
this.config = config;
|
|
12
|
-
this.inboxStore = inboxStore;
|
|
13
|
-
this._sessionStore = _sessionStore;
|
|
14
|
-
this.logger = logger;
|
|
15
|
-
this.projectIdentityResolver = projectIdentityResolver;
|
|
16
|
-
}
|
|
17
|
-
async getInboxCount(input) {
|
|
18
|
-
const resolved = this.projectIdentityResolver.resolveSessionDefaults(input);
|
|
19
|
-
const total = await this.inboxStore.countInboxMessages(resolved.sessionId);
|
|
20
|
-
this.logger.info("Telegram inbox count fetched", {
|
|
21
|
-
sessionId: resolved.sessionId,
|
|
22
|
-
sessionIdDerived: resolved.sessionIdDerived,
|
|
23
|
-
total,
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
session_id: resolved.sessionId,
|
|
27
|
-
total,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
async getInbox(input) {
|
|
31
|
-
const resolved = this.projectIdentityResolver.resolveSessionDefaults(input);
|
|
32
|
-
const limit = this.config.telegram.inboxBatchSize;
|
|
33
|
-
const messages = await this.inboxStore.listInboxMessages(resolved.sessionId, limit);
|
|
34
|
-
const total = await this.inboxStore.countInboxMessages(resolved.sessionId);
|
|
35
|
-
this.logger.info("Telegram inbox fetched", {
|
|
36
|
-
sessionId: resolved.sessionId,
|
|
37
|
-
sessionIdDerived: resolved.sessionIdDerived,
|
|
38
|
-
limit,
|
|
39
|
-
returned: messages.length,
|
|
40
|
-
total,
|
|
41
|
-
});
|
|
42
|
-
return {
|
|
43
|
-
session_id: resolved.sessionId,
|
|
44
|
-
total,
|
|
45
|
-
has_more: total > messages.length,
|
|
46
|
-
messages: messages.map((message) => ({
|
|
47
|
-
message_id: message.id,
|
|
48
|
-
source: "telegram",
|
|
49
|
-
message_kind: message.sourceTelegramMessageId > 0 ? "human" : "system",
|
|
50
|
-
telegram_chat_id: message.telegramChatId,
|
|
51
|
-
telegram_user_id: message.telegramUserId,
|
|
52
|
-
telegram_message_id: message.sourceTelegramMessageId,
|
|
53
|
-
text: message.text,
|
|
54
|
-
...(message.attachments?.length
|
|
55
|
-
? { attachments: message.attachments }
|
|
56
|
-
: {}),
|
|
57
|
-
received_at: message.receivedAt,
|
|
58
|
-
})),
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
async deleteInboxMessage(input) {
|
|
62
|
-
const resolved = this.projectIdentityResolver.resolveSessionDefaults(input);
|
|
63
|
-
const deleted = await this.inboxStore.deleteInboxMessage(resolved.sessionId, input.message_id);
|
|
64
|
-
this.logger.info("Telegram inbox message deleted", {
|
|
65
|
-
sessionId: resolved.sessionId,
|
|
66
|
-
sessionIdDerived: resolved.sessionIdDerived,
|
|
67
|
-
messageId: input.message_id,
|
|
68
|
-
deleted,
|
|
69
|
-
});
|
|
70
|
-
return {
|
|
71
|
-
deleted,
|
|
72
|
-
session_id: resolved.sessionId,
|
|
73
|
-
message_id: input.message_id,
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
exports.InboxService = InboxService;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClearSessionPairingTool = void 0;
|
|
4
|
-
const schema_1 = require("../../../entities/request/model/schema");
|
|
5
|
-
function createContent(output) {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
type: "text",
|
|
9
|
-
text: JSON.stringify(output, null, 2),
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
class ClearSessionPairingTool {
|
|
14
|
-
pairSessionService;
|
|
15
|
-
constructor(pairSessionService) {
|
|
16
|
-
this.pairSessionService = pairSessionService;
|
|
17
|
-
}
|
|
18
|
-
register(server) {
|
|
19
|
-
server.registerTool("clear_session_pairing", {
|
|
20
|
-
title: "Clear Session Pairing",
|
|
21
|
-
description: "Use this when the user asks to unpair, unlink, detach, or reset Telegram binding for the current session. Remove Telegram binding for a session so it can be paired again.",
|
|
22
|
-
inputSchema: schema_1.clearSessionPairingInputSchema,
|
|
23
|
-
outputSchema: schema_1.clearSessionPairingOutputSchema,
|
|
24
|
-
}, async (args) => {
|
|
25
|
-
const output = await this.pairSessionService.clearPairing(args);
|
|
26
|
-
return {
|
|
27
|
-
content: createContent(output),
|
|
28
|
-
structuredContent: output,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.ClearSessionPairingTool = ClearSessionPairingTool;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateSessionPairCodeTool = void 0;
|
|
4
|
-
const schema_1 = require("../../../entities/request/model/schema");
|
|
5
|
-
function createContent(output) {
|
|
6
|
-
return [
|
|
7
|
-
{
|
|
8
|
-
type: "text",
|
|
9
|
-
text: JSON.stringify(output, null, 2),
|
|
10
|
-
},
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
class CreateSessionPairCodeTool {
|
|
14
|
-
pairSessionService;
|
|
15
|
-
constructor(pairSessionService) {
|
|
16
|
-
this.pairSessionService = pairSessionService;
|
|
17
|
-
}
|
|
18
|
-
register(server) {
|
|
19
|
-
server.registerTool("create_session_pair_code", {
|
|
20
|
-
title: "Create Session Pair Code",
|
|
21
|
-
description: "Use this when the user asks to link, pair, register, or connect the current agent/session to Telegram. Before calling it, determine the correct workspace cwd and, if tmux is available, collect current tmux attributes. Then create a short-lived Telegram pairing code for that session. After success, remember the returned session_id and pass it explicitly to later session-scoped tools.",
|
|
22
|
-
inputSchema: schema_1.createSessionPairCodeInputSchema,
|
|
23
|
-
outputSchema: schema_1.createSessionPairCodeOutputSchema,
|
|
24
|
-
}, async (args) => {
|
|
25
|
-
const output = await this.pairSessionService.createPairCode(args);
|
|
26
|
-
return {
|
|
27
|
-
content: createContent(output),
|
|
28
|
-
structuredContent: output,
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.CreateSessionPairCodeTool = CreateSessionPairCodeTool;
|