@deadragdoll/tellymcp 0.0.13 → 0.0.15

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 (86) hide show
  1. package/.env.example.client +23 -39
  2. package/.env.example.gateway +52 -61
  3. package/CHANGELOG.md +57 -0
  4. package/README-ru.md +80 -6
  5. package/README.md +80 -6
  6. package/TOOLS.md +219 -10
  7. package/config/templates/env.both.template +19 -7
  8. package/config/templates/env.client.template +9 -19
  9. package/config/templates/env.gateway.template +19 -31
  10. package/dist/cli.js +252 -47
  11. package/dist/configureServer.js +966 -0
  12. package/dist/envMigration.js +316 -0
  13. package/dist/moleculer.config.js +1 -3
  14. package/dist/services/features/telegram-mcp/approval.service.js +1 -1
  15. package/dist/services/features/telegram-mcp/browser.service.js +18 -0
  16. package/dist/services/features/telegram-mcp/collaboration.service.js +2 -2
  17. package/dist/services/features/telegram-mcp/ensuredb.service.js +1 -1
  18. package/dist/services/features/telegram-mcp/file-content.service.js +94 -0
  19. package/dist/services/features/telegram-mcp/gateway-delivery.service.js +5 -1
  20. package/dist/services/features/telegram-mcp/gateway-socket.service.js +43 -11
  21. package/dist/services/features/telegram-mcp/gateway.service.js +1 -1
  22. package/dist/services/features/telegram-mcp/mcp-http.service.js +1 -0
  23. package/dist/services/features/telegram-mcp/mcp-server.service.js +20 -0
  24. package/dist/services/features/telegram-mcp/session-context.service.js +25 -1
  25. package/dist/services/features/telegram-mcp/src/app/bootstrap/runtime.js +79 -67
  26. package/dist/services/features/telegram-mcp/src/app/config/env.js +129 -38
  27. package/dist/services/features/telegram-mcp/src/app/config/environmentContract.js +66 -0
  28. package/dist/services/features/telegram-mcp/src/app/http.js +139 -99
  29. package/dist/services/features/telegram-mcp/src/app/oauthFacade.js +642 -0
  30. package/dist/services/features/telegram-mcp/src/app/webapp/assets.js +151 -170
  31. package/dist/services/features/telegram-mcp/src/app/webapp/auth.js +96 -99
  32. package/dist/services/features/telegram-mcp/src/entities/request/model/schema.js +88 -19
  33. package/dist/services/features/telegram-mcp/src/features/browser/model/browserAttachActiveTabTool.js +28 -0
  34. package/dist/services/features/telegram-mcp/src/features/browser/model/browserAttachTabTool.js +28 -0
  35. package/dist/services/features/telegram-mcp/src/features/browser/model/browserDetachTabTool.js +28 -0
  36. package/dist/services/features/telegram-mcp/src/features/browser/model/browserListAttachedInstancesTool.js +1 -1
  37. package/dist/services/features/telegram-mcp/src/features/browser/model/browserListTabsTool.js +1 -1
  38. package/dist/services/features/telegram-mcp/src/features/browser/model/browserService.js +412 -29
  39. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/browserRecordingBundle.js +37 -3
  40. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/firefoxAttachRegistry.js +7 -6
  41. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/firefoxAttachServer.js +214 -37
  42. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/types.js +186 -0
  43. package/dist/services/features/telegram-mcp/src/features/collaboration/model/collaborationService.js +2 -0
  44. package/dist/services/features/telegram-mcp/src/features/collaboration/model/gatewaySessionsService.js +5 -5
  45. package/dist/services/features/telegram-mcp/src/features/collaboration/model/sendPartnerFileService.js +6 -3
  46. package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayClientAccess.js +5 -2
  47. package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayCollaborationBackend.js +4 -4
  48. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayHttpService.js +33 -36
  49. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/remoteConsoleActionClient.js +4 -3
  50. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileListTool.js +33 -0
  51. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileService.js +327 -0
  52. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileTool.js +81 -0
  53. package/dist/services/features/telegram-mcp/src/features/file-content/model/temporaryFileLinkStore.js +307 -0
  54. package/dist/services/features/telegram-mcp/src/features/file-content/model/workspaceFilePolicy.js +115 -0
  55. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyService.js +9 -5
  56. package/dist/services/features/telegram-mcp/src/features/session-context/model/getRuntimeDiagnosticsTool.js +30 -0
  57. package/dist/services/features/telegram-mcp/src/features/session-context/model/sessionContextService.js +169 -7
  58. package/dist/services/features/telegram-mcp/src/shared/integrations/memory/processLocalStateStore.js +260 -0
  59. package/dist/services/features/telegram-mcp/src/shared/integrations/object-storage/minioExchangeStore.js +1 -1
  60. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transport.js +4 -1
  61. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportConsoleRegistry.js +2 -2
  62. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportFileHandoffActions.js +6 -3
  63. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportMessageFlow.js +1 -1
  64. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportProjectState.js +2 -2
  65. package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/client.js +29 -6
  66. package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/ptyRegistry.js +100 -2
  67. package/dist/services/features/telegram-mcp/src/shared/lib/bodyLimits.js +63 -0
  68. package/dist/services/features/telegram-mcp/src/shared/lib/gatewayAuth.js +13 -0
  69. package/dist/services/features/telegram-mcp/src/shared/lib/gatewayScope.js +5 -5
  70. package/dist/services/features/telegram-mcp/src/shared/lib/project-identity/projectIdentity.js +10 -0
  71. package/dist/services/features/telegram-mcp/src/shared/lib/time/localTimestamp.js +21 -0
  72. package/docs/CHAT_CONNECTOR.md +134 -0
  73. package/docs/STANDALONE-ru.md +41 -3
  74. package/docs/STANDALONE.md +41 -3
  75. package/package.json +5 -3
  76. package/packages/chrome-attach-extension/dist/background.js +572 -163
  77. package/packages/chrome-attach-extension/dist/manifest.json +2 -1
  78. package/packages/chrome-attach-extension/dist/options.js +15 -2
  79. package/packages/chrome-attach-extension/dist/recorder-content.js +14 -1
  80. package/packages/chrome-attach-extension/dist/recorder-page.js +34 -18
  81. package/packages/firefox-attach-extension/dist/background.js +413 -33
  82. package/packages/firefox-attach-extension/dist/manifest.json +0 -12
  83. package/packages/firefox-attach-extension/dist/options.js +14 -1
  84. package/packages/firefox-attach-extension/dist/recorder-content.js +14 -1
  85. package/packages/firefox-attach-extension/dist/recorder-page.js +34 -18
  86. package/scripts/postinstall.js +33 -1
package/README.md CHANGED
@@ -27,6 +27,7 @@ The current model is gateway-first:
27
27
 
28
28
  - exposes MCP tools for human Telegram interaction
29
29
  - lets one agent ask another agent to do work and return files or notes
30
+ - lets MCP chat clients retrieve project text, images, and artifacts from a selected console
30
31
  - stores structured xchange records in `.mcp-xchange`
31
32
  - supports browser automation with Playwright
32
33
  - can attach to an already running Firefox or Chrome tab through bundled local extensions
@@ -66,6 +67,7 @@ Human-facing:
66
67
  - `telegram_message` records
67
68
  - `notify_telegram`
68
69
  - `browser_screenshot(send_to_telegram=true)`
70
+ - `get_file` for returning screenshots and artifacts to MCP chat clients
69
71
 
70
72
  Agent-to-agent:
71
73
 
@@ -74,6 +76,10 @@ Agent-to-agent:
74
76
  - `send_partner_file`
75
77
  - `list_gateway_sessions`
76
78
 
79
+ Diagnostics:
80
+
81
+ - `get_runtime_diagnostics` for safe end-to-end gateway/client health checks
82
+
77
83
  Browser:
78
84
 
79
85
  - `browser_open`
@@ -87,6 +93,15 @@ Browser:
87
93
  - `browser_recording_stop`
88
94
  - `browser_recording_status`
89
95
 
96
+ Files:
97
+
98
+ - `get_file_list(source=..., limit=...)`
99
+ - `get_file(file_path=..., type="url")`
100
+ - `get_file(file_path=..., type="image")`
101
+ - `get_file(file_path=..., type="text")`
102
+ - `get_file(file_path=..., type="base64")`
103
+ - `get_file(selector="latest_screenshot")`
104
+
90
105
  Tools sync:
91
106
 
92
107
  - `refresh_tools_markdown`
@@ -95,17 +110,38 @@ Tools sync:
95
110
  ## Requirements
96
111
 
97
112
  - Node.js `>= 24`
98
- - Redis
113
+ - Python 3, `make`, and a C/C++ toolchain on Linux so `node-pty` can build its native addon; npm lifecycle scripts must be enabled
114
+ - Redis for gateway and `both` modes only; clients do not use Redis
99
115
  - PostgreSQL for gateway mode
100
116
  - optional RabbitMQ for durable gateway fanout
101
117
  - Playwright browser binaries if you use browser tools
102
118
 
103
119
  ## Installation
104
120
 
121
+ On Debian/Ubuntu, install the native PTY build prerequisites first:
122
+
123
+ ```bash
124
+ sudo apt install -y python3 make g++
125
+ npm config set ignore-scripts false
126
+ ```
127
+
128
+ ```bash
129
+ npm install -g @deadragdoll/tellymcp --foreground-scripts
130
+ ```
131
+
132
+ The published `node-pty` dependency does not provide a Linux ARM64 binary, so
133
+ the install lifecycle builds `pty.node` locally. If a previous installation
134
+ completed without it, repair the global package with:
135
+
105
136
  ```bash
106
- npm install -g @deadragdoll/tellymcp
137
+ npm rebuild -g @deadragdoll/tellymcp --foreground-scripts
138
+ tellymcp doctor --env <file>
107
139
  ```
108
140
 
141
+ `tellymcp --help` and setup commands do not load the native PTY module. Runtime
142
+ startup validates it and prints the same recovery instructions instead of a
143
+ raw native-module stack trace.
144
+
109
145
  Optional browser runtime:
110
146
 
111
147
  ```bash
@@ -139,9 +175,20 @@ Create a gateway workspace and env:
139
175
  ```bash
140
176
  mkdir -p ~/telly-gateway
141
177
  cd ~/telly-gateway
142
- tellymcp init gateway
178
+ tellymcp configure
143
179
  ```
144
180
 
181
+ This opens a token-protected local page on `127.0.0.1`. Choose `Gateway` in the
182
+ wizard, fill and validate the settings, then save `.env-gateway` through the
183
+ normal browser download flow. Set its permissions to `0600` before use. Use
184
+ `tellymcp init gateway` when you specifically want a commented template for
185
+ manual editing.
186
+
187
+ Enter the public origin or API base only once. The wizard derives gateway HTTP,
188
+ WebSocket, Mini App, webhook, root-prefix, and optional OAuth connector URLs.
189
+ The key stages include live connection checks for Telegram, Redis, PostgreSQL,
190
+ the gateway HTTP/WebSocket endpoints, and optional RabbitMQ.
191
+
145
192
  Or copy the sample from this package:
146
193
 
147
194
  - [.env.example.gateway](./.env.example.gateway)
@@ -156,7 +203,8 @@ Required gateway values:
156
203
  - `DB_NAME`
157
204
  - `GATEWAY_PUBLIC_URL`
158
205
  - `GATEWAY_WS_URL`
159
- - `GATEWAY_TOKEN`
206
+ - `GATEWAY_SCOPE_TOKEN`
207
+ - `GATEWAY_AUTH_TOKEN`
160
208
 
161
209
  Then run:
162
210
 
@@ -171,9 +219,17 @@ Create one workspace per agent console:
171
219
  ```bash
172
220
  mkdir -p ~/agent-a
173
221
  cd ~/agent-a
174
- tellymcp init client
222
+ tellymcp configure
175
223
  ```
176
224
 
225
+ Choose `Client` in the wizard. The form includes the gateway connection, local
226
+ console identity, terminal, browser, MCP, and advanced runtime settings.
227
+ After validation the browser downloads `.env-client`. Use `--no-open` to print
228
+ the local URL without opening a browser automatically.
229
+
230
+ For clients, the same Public base URL automatically produces
231
+ `GATEWAY_PUBLIC_URL`, `GATEWAY_WS_URL`, and `GATEWAY_WS_PATH`.
232
+
177
233
  Or copy:
178
234
 
179
235
  - [.env.example.client](./.env.example.client)
@@ -182,7 +238,8 @@ Required client values:
182
238
 
183
239
  - `GATEWAY_PUBLIC_URL`
184
240
  - `GATEWAY_WS_URL`
185
- - `GATEWAY_TOKEN`
241
+ - `GATEWAY_SCOPE_TOKEN`
242
+ - `GATEWAY_AUTH_TOKEN` (the same transport token configured on the gateway)
186
243
  - `GATEWAY_USER_UUID` if this console should be scoped to a specific Telegram owner
187
244
 
188
245
  Recommended:
@@ -201,6 +258,10 @@ After that, `.mcpsession.json` stores:
201
258
  - `local_session_id`
202
259
  - `session_label`
203
260
  - `env_file`
261
+ - `gateway_client_uuid`
262
+
263
+ Client runtime state is local and does not require Redis. The persisted
264
+ `gateway_client_uuid` keeps the client identity stable across restarts.
204
265
 
205
266
  So later the same workspace can usually start with:
206
267
 
@@ -339,6 +400,7 @@ Expected agent behavior:
339
400
 
340
401
  Use the shipped samples as the canonical starting point:
341
402
 
403
+ - [Environment contract and migration guide](./docs/ENVIRONMENT.md)
342
404
  - [.env.example.gateway](./.env.example.gateway)
343
405
  - [.env.example.client](./.env.example.client)
344
406
 
@@ -354,6 +416,8 @@ The samples were cleaned to match the current runtime:
354
416
  - removed obsolete pairing-oriented wording
355
417
  - removed unused secrets like `SESSION_SECRET`
356
418
  - removed unused `APP_NAME`
419
+ - renamed ambiguous legacy keys to `TERMINAL_*`, `GATEWAY_SCOPE_TOKEN`,
420
+ `TELEGRAM_REQUEST_MODE`, `DB_SCHEMA`, and `LOGFEED_ENABLED`
357
421
 
358
422
  ## Operational Commands
359
423
 
@@ -369,11 +433,21 @@ Destructive local+gateway cleanup:
369
433
  tellymcp system-prune --env .env --yes
370
434
  ```
371
435
 
436
+ Normalize an older env file to the current role-aware contract:
437
+
438
+ ```bash
439
+ tellymcp migrate-env ./old.env > ./.migrated-env
440
+ ```
441
+
442
+ The runtime does not fall back to the old schema. If legacy keys are detected,
443
+ startup stops and prints the migration command.
444
+
372
445
  ## Documentation Map
373
446
 
374
447
  - [README-ru.md](./README-ru.md)
375
448
  - [STANDALONE.md](./docs/STANDALONE.md)
376
449
  - [STANDALONE-ru.md](./docs/STANDALONE-ru.md)
450
+ - [CHAT_CONNECTOR.md](./docs/CHAT_CONNECTOR.md) — ChatGPT/Claude OAuth connector
377
451
  - [TOOLS.md](./TOOLS.md)
378
452
  - [screenshots/README.md](./screenshots/README.md)
379
453
 
package/TOOLS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tools
2
2
 
3
- Version: `2026-06-06.1`
3
+ Version: `2026-06-06.2`
4
4
 
5
5
  Gateway/client runtime compatibility:
6
6
 
@@ -18,6 +18,9 @@ Browser tools:
18
18
 
19
19
  - `browser_list_attached_instances`
20
20
  - `browser_list_tabs`
21
+ - `browser_attach_active_tab`
22
+ - `browser_attach_tab`
23
+ - `browser_detach_tab`
21
24
  - `browser_recording_start`
22
25
  - `browser_recording_stop`
23
26
  - `browser_recording_status`
@@ -44,8 +47,8 @@ Browser runtime rule:
44
47
  - attached browser tab backend for a real user Firefox or Chrome session
45
48
  - isolated Playwright Chromium backend
46
49
  - `browser_open` is only for the isolated Playwright backend.
47
- - `browser_list_attached_instances` and `browser_list_tabs` are for the attached browser backend.
48
- - if the local attach extension is connected and a tab was selected from the browser control panel, `browser_click`, `browser_fill`, `browser_inject_script`, `browser_press`, `browser_dom`, and `browser_screenshot` use that attached browser tab for the current session without requiring `browser_open`
50
+ - `browser_list_attached_instances`, `browser_list_tabs`, `browser_attach_active_tab`, `browser_attach_tab`, and `browser_detach_tab` are for the attached browser backend.
51
+ - after a tab is attached for the current session, `browser_click`, `browser_fill`, `browser_inject_script`, `browser_press`, `browser_wait_for`, `browser_wait_for_url`, `browser_dom`, `browser_computed_style`, `browser_reload`, `browser_screenshot`, `browser_console`, `browser_errors`, `browser_network_failures`, `browser_clear_logs`, and `browser_close` use that attached browser tab without requiring `browser_open`
49
52
  - `browser_recording_start`, `browser_recording_stop`, and `browser_recording_status` are also for the attached browser backend
50
53
  - browser recordings are written under `.mcp-xchange/web/{tab-title-slug}-{timestamp}/`
51
54
  - each recording bundle contains `session.json`, `timeline.ndjson`, `pages/`, `network/`, and `console/`
@@ -80,13 +83,16 @@ Collaboration tools:
80
83
 
81
84
  Utility tools:
82
85
 
86
+ - `get_file_list`
87
+ - `get_file`
83
88
  - `refresh_tools_markdown`
84
89
 
85
90
  ## Console model
86
91
 
87
92
  Gateway-first runtime model:
88
93
 
89
- - agents register themselves on the gateway automatically through `GATEWAY_TOKEN`
94
+ - agents authenticate the gateway HTTP/WS transport through `GATEWAY_AUTH_TOKEN`
95
+ and register into their gateway scope through `GATEWAY_SCOPE_TOKEN`
90
96
  - Telegram no longer links sessions with pair codes
91
97
  - `/menu` in the gateway bot shows available remote consoles directly
92
98
  - one running agent console is one logical session/console target
@@ -111,7 +117,18 @@ Preferred order for cross-console work:
111
117
  - `send_partner_note`
112
118
  - `send_partner_file`
113
119
  - browser tools
114
- with explicit `session_id` for the current console or explicit target routing fields for another console.
120
+ with explicit `session_id` for the current console or explicit target routing fields for another console.
121
+
122
+ Preferred file-return flow for MCP chat clients:
123
+
124
+ 1. Resolve the selected live console and keep its canonical `session_id`.
125
+ 2. If the user refers to an existing managed file without an exact path, call `get_file_list` and select the matching `file_path`.
126
+ 3. If creating a screenshot now, call `browser_screenshot` and keep its returned `file_path`.
127
+ 4. For an exact Markdown, source-code, or other UTF-8 project path, call `get_file(type = "text")`; arbitrary project files are not discovered by `get_file_list`.
128
+ 5. For binary files, call `get_file` with the selected or newly returned `file_path`; default to `type = "url"`.
129
+ 6. If the chat cannot fetch an image URL, repeat the same call with `type = "image"` for a native inline MCP image block.
130
+ 7. If a host such as Claude.ai replaces the native block with `[image]`, retry with `type = "base64"`; this host-independent fallback returns the complete JSON, including raw `data`, in a regular MCP text block.
131
+ 8. If the user asks for the most recent existing screenshot, `get_file(selector = "latest_screenshot")` is the direct shortcut.
115
132
 
116
133
  ## `set_session_context`
117
134
 
@@ -190,6 +207,136 @@ Output:
190
207
  - `terminal?`
191
208
  Terminal runtime metadata for the console.
192
209
 
210
+ ## `get_runtime_diagnostics`
211
+
212
+ Purpose:
213
+
214
+ - Run safe, read-only health checks for one console through the same gateway route used by normal tools.
215
+ - Diagnose configuration, runtime state storage, PTY state, version/protocol metadata, and gateway-to-client relay without returning secrets or raw connection strings.
216
+ - Redis is probed only for gateway/`both` runtimes. On a client, the `redis` compatibility check reports that Redis is not required and process-local state is active.
217
+ - Return a structured degraded result when relay fails instead of a deeply nested backend exception.
218
+
219
+ Input:
220
+
221
+ - `session_id?`
222
+ In gateway mode, use the canonical `session_id` returned by `list_gateway_sessions`.
223
+
224
+ Output:
225
+
226
+ - `status`
227
+ - `ok`
228
+ - `degraded`
229
+ - `checked_at`
230
+ - `session_id`
231
+ - `runtime`
232
+ - `mode`
233
+ - `package_version`
234
+ - `protocol_version`
235
+ - `node_id?`
236
+ - `checks`
237
+ - `configuration`
238
+ - `redis`
239
+ - `session_store`
240
+ - `terminal`
241
+ - `gateway_configuration`
242
+ - `relay`
243
+
244
+ Each check contains only `status` and a redacted human-readable `message`.
245
+
246
+ ## `get_file_list`
247
+
248
+ Purpose:
249
+
250
+ - List managed files available in a selected console workspace before calling `get_file`.
251
+ - Return exact `file_path` values accepted by `get_file`.
252
+
253
+ Input:
254
+
255
+ - `session_id`
256
+ - `source?`
257
+ - `telegram-upload`
258
+ - `browser-screenshot`
259
+ - `partner-artifact`
260
+ - `limit?`
261
+ - default: `50`
262
+ - maximum: `200`
263
+
264
+ Output:
265
+
266
+ - `total`
267
+ - `files[]`
268
+ - `file_path`
269
+ - `filename`
270
+ - `mimetype`
271
+ - `source`
272
+ - `size_bytes?`
273
+ - `created_at`
274
+
275
+ Behavior:
276
+
277
+ - results are ordered newest first
278
+ - `total` is the number of matching managed files before `limit` is applied
279
+ - this tool lists TellyMCP-managed Telegram uploads, browser screenshots, and partner artifacts; it does not recursively enumerate arbitrary source files in the workspace
280
+ - in gateway mode, always pass the canonical `session_id = client_uuid:local_session_id`
281
+ - pass the chosen `files[].file_path` unchanged to `get_file`
282
+
283
+ ## `get_file`
284
+
285
+ Purpose:
286
+
287
+ - Return the actual content of a file from a selected console workspace to an MCP chat client.
288
+ - URL mode creates a bounded temporary gateway copy; text and base64 modes relay content directly.
289
+
290
+ Input:
291
+
292
+ - `session_id`
293
+ - `type?`
294
+ - `url` (default)
295
+ - `image` (native inline image plus download URL)
296
+ - `text` (native UTF-8 MCP text content)
297
+ - `base64` (fallback)
298
+ - exactly one of:
299
+ - `file_path`
300
+ - `selector = "latest_screenshot"`
301
+
302
+ Output:
303
+
304
+ - `type`
305
+ - `data`
306
+ - short-lived HTTPS URL when `type = "url"`
307
+ - short-lived HTTPS URL when `type = "image"`; the actual pixels are in the native MCP image content block
308
+ - decoded UTF-8 file content when `type = "text"`
309
+ - base64 payload when `type = "base64"`
310
+ - `mimetype`
311
+ - `filename`
312
+ - `size_bytes`
313
+ - `expires_at?`
314
+
315
+ Behavior:
316
+
317
+ - in gateway mode, always pass the canonical `session_id = client_uuid:local_session_id` returned by `list_gateway_sessions`
318
+ - `file_path` may be the exact path returned by `browser_screenshot`, so the human does not need to know generated filenames
319
+ - `selector = "latest_screenshot"` selects the newest file metadata with `source = "browser-screenshot"` for that session
320
+ - file reads are limited to the selected console workspace, including after symlink resolution
321
+ - exact project-relative paths such as `README.md` or `src/test.ts` are accepted even though `get_file_list` only discovers managed artifacts
322
+ - text mode returns the decoded file directly as a native MCP text content block and rejects invalid UTF-8 or binary NUL content
323
+ - source extensions such as `.ts` and `.tsx` use text MIME overrides instead of the generic MPEG/octet-stream mappings
324
+ - sensitive paths including live `.env` files, credential stores, private-key extensions, and secret directories are rejected server-side; documented `.env.example`/`.env.sample`/`.env.template` files remain readable
325
+ - URL mode uploads the file as a binary stream to `.tellymcp/tmp/file-links` on the gateway and returns a link valid for 10 minutes
326
+ - temporary-link filenames are sanitized before storage and download headers: control and filesystem-reserved characters are replaced, while a safe basename is preserved
327
+ - image mode is explicit: `structuredContent.type` is `image`, `structuredContent.data` contains the URL, and the native top-level MCP `image` is the first content block without duplicating base64 into structured output
328
+ - image mode accepts only `image/*` files up to the safe native-inline limit; use `url` for larger images
329
+ - URL links allow up to three GET downloads; HEAD requests do not consume the limit
330
+ - if URL fetching fails for an image, retry with `type = "image"`
331
+ - base64 mode is the compatibility fallback for hosts that replace native images with `[image]` or hide `structuredContent`: it returns the complete JSON payload, including raw base64 in `data`, as a regular MCP text block and does not emit a native image
332
+ - base64 mode is bounded by the final MCP response body limit
333
+ - do not attempt to bypass the sensitive-file policy or retrieve renamed secrets
334
+
335
+ Screenshot examples:
336
+
337
+ - "take a screenshot and send it": call `browser_screenshot`, then pass its returned `file_path` to `get_file`
338
+ - "send the latest screenshot": call `get_file` with `selector = "latest_screenshot"`
339
+
193
340
  ## `refresh_tools_markdown`
194
341
 
195
342
  Purpose:
@@ -447,7 +594,7 @@ Required agent practice:
447
594
  - "tell frontend what changed"
448
595
  - "send the error to your teammate"
449
596
  - "tell the other agent what's new"
450
- then the correct path is `send_partner_note`
597
+ then the correct path is `send_partner_note`
451
598
 
452
599
  How to find the partner correctly:
453
600
 
@@ -507,7 +654,7 @@ Reply rule for project asks:
507
654
  - `Reply project_uuid: ...`
508
655
  - `Reply target_client_uuid: ...`
509
656
  - `Reply target_local_session_id: ...`
510
- or a `Reply Params` section with the same data
657
+ or a `Reply Params` section with the same data
511
658
  - then reply with those exact values
512
659
  - if `in_reply_to` is available, prefer `Reply message_uuid`
513
660
  - if only the note `share_id` is available, gateway now also accepts that value in `in_reply_to`
@@ -608,7 +755,7 @@ How the receiving agent must react:
608
755
  - `проверь xchange records`
609
756
  - `telegram_message`
610
757
  - `partner_note`
611
- then do not start with a legacy inbox-specific tool
758
+ then do not start with a legacy inbox-specific tool
612
759
  - instead:
613
760
  1. call `list_xchange_records`
614
761
  2. identify the newest relevant record by category:
@@ -836,10 +983,68 @@ Output:
836
983
  Notes:
837
984
 
838
985
  - if only one attached browser instance is connected, `instance_id` can be omitted
839
- - current tab selection for the attach backend is done from the browser extension control panel
986
+ - tab selection for the attach backend can be done either from the browser extension control panel or through `browser_attach_active_tab` / `browser_attach_tab`
840
987
  - `active=true` means the tab is active in its browser window; there may be more than one such tab across multiple windows
841
988
  - for the tab currently selected for this MCP session, prefer `selected=true`
842
989
 
990
+ ## `browser_attach_active_tab`
991
+
992
+ Purpose:
993
+
994
+ - attach the current MCP session to the active tab of a connected attached browser instance
995
+
996
+ Input:
997
+
998
+ - `session_id?`
999
+ - `instance_id?`
1000
+
1001
+ Output:
1002
+
1003
+ - `session_id`
1004
+ - `backend`
1005
+ - `instance_id`
1006
+ - `tab_id`
1007
+ - `attached_at`
1008
+ - `title?`
1009
+ - `url?`
1010
+
1011
+ ## `browser_attach_tab`
1012
+
1013
+ Purpose:
1014
+
1015
+ - attach the current MCP session to a specific attached browser tab by `tab_id`
1016
+
1017
+ Input:
1018
+
1019
+ - `session_id?`
1020
+ - `instance_id?`
1021
+ - `tab_id`
1022
+
1023
+ Output:
1024
+
1025
+ - `session_id`
1026
+ - `backend`
1027
+ - `instance_id`
1028
+ - `tab_id`
1029
+ - `attached_at`
1030
+ - `title?`
1031
+ - `url?`
1032
+
1033
+ ## `browser_detach_tab`
1034
+
1035
+ Purpose:
1036
+
1037
+ - detach the current MCP session from the currently selected attached browser tab
1038
+
1039
+ Input:
1040
+
1041
+ - `session_id?`
1042
+
1043
+ Output:
1044
+
1045
+ - `session_id`
1046
+ - `detached`
1047
+
843
1048
  ## `browser_recording_start`
844
1049
 
845
1050
  Purpose:
@@ -1227,6 +1432,8 @@ Output:
1227
1432
  Purpose:
1228
1433
 
1229
1434
  - inspect computed styles and box metrics for a DOM element in the session browser tab
1435
+ - if the session has a selected attached browser tab, inspect that real browser tab
1436
+ - otherwise inspect the isolated Playwright page
1230
1437
 
1231
1438
  Input:
1232
1439
 
@@ -1284,7 +1491,9 @@ Notes:
1284
1491
 
1285
1492
  Purpose:
1286
1493
 
1287
- - close the isolated browser context for the current session
1494
+ - close the current browser target for the session
1495
+ - if the session has a selected attached browser tab, close that real browser tab and clear the attach state
1496
+ - otherwise close the isolated Playwright browser context
1288
1497
 
1289
1498
  Input:
1290
1499
 
@@ -19,8 +19,7 @@ REDIS_HOST=127.0.0.1
19
19
  REDIS_PORT=6379
20
20
  REDIS_DB=1
21
21
 
22
- MODE=reject
23
- PAIR_CODE_TTL_SECONDS=300
22
+ TELEGRAM_REQUEST_MODE=reject
24
23
 
25
24
  MCP_HTTP_HOST=127.0.0.1
26
25
  MCP_HTTP_PORT=8787
@@ -29,13 +28,27 @@ MCP_HTTP_PATH=/mcp
29
28
  MCP_HTTP_ENABLE_DEBUG_ROUTES=false
30
29
  MCP_HTTP_ENABLE_PRUNE_ROUTE=false
31
30
 
31
+ # ChatGPT / Claude OAuth connector. Setting any OAuth value enables the facade.
32
+ # TELLYMCP_PUBLIC_URL=https://your-domain.example/api
33
+ # TELLYMCP_OAUTH_ISSUER=https://your-domain.example/api
34
+ # TELLYMCP_OAUTH_AUDIENCE=https://your-domain.example/api
35
+ # TELLYMCP_MAGIC_TOKEN=change_me_private_connector_token
36
+ # TELLYMCP_MAGIC_TOKEN_HASH=sha256:<hex>
37
+ # TELLYMCP_OAUTH_CLIENT_ID=tellymcp
38
+ # TELLYMCP_OAUTH_CLIENT_SECRET=
39
+ # TELLYMCP_ALLOWED_REDIRECT_URIS=https://chatgpt.com/connector/oauth/...,https://claude.ai/api/mcp/auth_callback
40
+ # TELLYMCP_OAUTH_PRIVATE_KEY_PEM="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
41
+ # TELLYMCP_AUTH_CODE_TTL_SECONDS=300
42
+ # TELLYMCP_OAUTH_SCOPES=tellymcp:read tellymcp:write
43
+ # TELLYMCP_OAUTH_KEY_ID=tellymcp-oauth
44
+
32
45
  DISTRIBUTED_MODE=both
33
46
  GATEWAY_PUBLIC_URL=
34
47
  GATEWAY_WS_URL=
35
48
  GATEWAY_WS_PATH=/api/gateway/ws
36
- GATEWAY_TOKEN=
49
+ GATEWAY_SCOPE_TOKEN=
37
50
  GATEWAY_USER_UUID=
38
- # GATEWAY_AUTH_TOKEN=
51
+ GATEWAY_AUTH_TOKEN=
39
52
 
40
53
  ROOT_PREFIX=/api
41
54
  PORT=8080
@@ -47,7 +60,7 @@ DB_PORT=5432
47
60
  DB_USER=
48
61
  DB_PASSWORD=
49
62
  DB_NAME=
50
- DB_SCHEME=mcp
63
+ DB_SCHEMA=mcp
51
64
 
52
65
  # RMQ_HOST=127.0.0.1
53
66
  # RMQ_PORT=5672
@@ -63,7 +76,6 @@ WEBAPP_INITDATA_TTL_SECONDS=300
63
76
  WEBAPP_SESSION_TTL_SECONDS=900
64
77
  WEBAPP_LAUNCH_MODE=fullscreen
65
78
  WEBAPP_VISIBLE_SCREENS=10
66
- WEBAPP_POLL_INTERVAL_MS=2000
67
79
  WEBAPP_ACTION_COOLDOWN_MS=150
68
80
 
69
81
  MCP_XCHANGE_DIR=.mcp-xchange
@@ -100,4 +112,4 @@ BROWSER_SLOW_MO_MS=0
100
112
  LOG_LEVEL=info
101
113
  LOG_FILE_ENABLED=false
102
114
  LOG_FILE_PATH=.tellymcp/log.jsonl
103
- ENABLE_LOGFEED=0
115
+ LOGFEED_ENABLED=0
@@ -4,12 +4,8 @@
4
4
  # TELLYMCP_SESSION_ID=NEW
5
5
  # TELLYMCP_SESSION_LABEL=NEW
6
6
 
7
- REDIS_HOST=127.0.0.1
8
- REDIS_PORT=6379
9
- REDIS_DB=1
10
-
11
- MODE=reject
12
- PAIR_CODE_TTL_SECONDS=300
7
+ # Client state is process-local. Redis is gateway-only.
8
+ TELEGRAM_REQUEST_MODE=reject
13
9
 
14
10
  MCP_HTTP_HOST=127.0.0.1
15
11
  MCP_HTTP_PORT=8787
@@ -22,9 +18,9 @@ DISTRIBUTED_MODE=client
22
18
  GATEWAY_PUBLIC_URL=
23
19
  GATEWAY_WS_URL=
24
20
  GATEWAY_WS_PATH=/api/gateway/ws
25
- GATEWAY_TOKEN=
21
+ GATEWAY_SCOPE_TOKEN=
26
22
  GATEWAY_USER_UUID=
27
- # GATEWAY_AUTH_TOKEN=
23
+ GATEWAY_AUTH_TOKEN=
28
24
 
29
25
  TERMINAL_SHELL=bash
30
26
  TERMINAL_COLS=120
@@ -44,16 +40,6 @@ TERMINAL_PROMPT_SCAN_INTERVAL_SECONDS=15
44
40
  TERMINAL_PROMPT_SCAN_COOLDOWN_SECONDS=120
45
41
  TERMINAL_PROMPT_SCAN_STRATEGY=strict
46
42
  TERMINAL_PROMPT_SCAN_MIN_SCORE=5
47
- WEBAPP_ENABLED=true
48
- WEBAPP_BASE_PATH=/webapp
49
- WEBAPP_PUBLIC_URL=
50
- WEBAPP_INITDATA_TTL_SECONDS=300
51
- WEBAPP_SESSION_TTL_SECONDS=900
52
- WEBAPP_LAUNCH_MODE=fullscreen
53
- WEBAPP_VISIBLE_SCREENS=10
54
- WEBAPP_POLL_INTERVAL_MS=2000
55
- WEBAPP_ACTION_COOLDOWN_MS=150
56
-
57
43
  MCP_XCHANGE_DIR=.mcp-xchange
58
44
 
59
45
  BROWSER_ENABLED=true
@@ -66,6 +52,10 @@ BROWSER_WAIT_UNTIL=load
66
52
  # BROWSER_EXECUTABLE_PATH=
67
53
  # BROWSER_CHANNEL=chrome
68
54
  BROWSER_SLOW_MO_MS=0
55
+ # BROWSER_ATTACH_ENABLED=true
56
+ # BROWSER_ATTACH_WS_HOST=127.0.0.1
57
+ # BROWSER_ATTACH_WS_PORT=9999
58
+ # BROWSER_ATTACH_WS_PATH=/browser-attach/ws
69
59
 
70
60
  NAMESPACE=mcp
71
61
  NODE_ID=agent
@@ -73,4 +63,4 @@ NODE_ID=agent
73
63
  LOG_LEVEL=info
74
64
  LOG_FILE_ENABLED=false
75
65
  LOG_FILE_PATH=.tellymcp/log.jsonl
76
- ENABLE_LOGFEED=0
66
+ LOGFEED_ENABLED=0