@deadragdoll/tellymcp 0.0.12 → 0.0.14

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 (83) hide show
  1. package/.env.example.client +5 -1
  2. package/.env.example.gateway +16 -1
  3. package/CHANGELOG.md +30 -0
  4. package/README-ru.md +33 -0
  5. package/README.md +33 -0
  6. package/TOOLS.md +384 -9
  7. package/config/templates/env.both.template +15 -2
  8. package/config/templates/env.client.template +5 -2
  9. package/config/templates/env.gateway.template +15 -2
  10. package/dist/cli.js +137 -2
  11. package/dist/services/features/telegram-mcp/browser.service.js +56 -1
  12. package/dist/services/features/telegram-mcp/file-content.service.js +94 -0
  13. package/dist/services/features/telegram-mcp/gateway-delivery.service.js +5 -1
  14. package/dist/services/features/telegram-mcp/gateway-socket.service.js +43 -11
  15. package/dist/services/features/telegram-mcp/mcp-http.service.js +1 -0
  16. package/dist/services/features/telegram-mcp/mcp-server.service.js +30 -0
  17. package/dist/services/features/telegram-mcp/src/app/bootstrap/runtime.js +23 -1
  18. package/dist/services/features/telegram-mcp/src/app/config/env.js +132 -2
  19. package/dist/services/features/telegram-mcp/src/app/http.js +139 -99
  20. package/dist/services/features/telegram-mcp/src/app/oauthFacade.js +642 -0
  21. package/dist/services/features/telegram-mcp/src/app/webapp/assets.js +151 -170
  22. package/dist/services/features/telegram-mcp/src/app/webapp/auth.js +96 -99
  23. package/dist/services/features/telegram-mcp/src/entities/request/model/schema.js +205 -17
  24. package/dist/services/features/telegram-mcp/src/features/browser/model/browserAttachActiveTabTool.js +28 -0
  25. package/dist/services/features/telegram-mcp/src/features/browser/model/browserAttachTabTool.js +28 -0
  26. package/dist/services/features/telegram-mcp/src/features/browser/model/browserClickTool.js +1 -1
  27. package/dist/services/features/telegram-mcp/src/features/browser/model/browserDetachTabTool.js +28 -0
  28. package/dist/services/features/telegram-mcp/src/features/browser/model/browserDomTool.js +1 -1
  29. package/dist/services/features/telegram-mcp/src/features/browser/model/browserFillTool.js +1 -1
  30. package/dist/services/features/telegram-mcp/src/features/browser/model/browserInjectScriptTool.js +28 -0
  31. package/dist/services/features/telegram-mcp/src/features/browser/model/browserListAttachedInstancesTool.js +33 -0
  32. package/dist/services/features/telegram-mcp/src/features/browser/model/browserListTabsTool.js +33 -0
  33. package/dist/services/features/telegram-mcp/src/features/browser/model/browserPressTool.js +1 -1
  34. package/dist/services/features/telegram-mcp/src/features/browser/model/browserRecordingStartTool.js +28 -0
  35. package/dist/services/features/telegram-mcp/src/features/browser/model/browserRecordingStatusTool.js +28 -0
  36. package/dist/services/features/telegram-mcp/src/features/browser/model/browserRecordingStopTool.js +28 -0
  37. package/dist/services/features/telegram-mcp/src/features/browser/model/browserScreenshotTool.js +1 -1
  38. package/dist/services/features/telegram-mcp/src/features/browser/model/browserService.js +890 -23
  39. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/browserRecordingBundle.js +536 -0
  40. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/firefoxAttachRegistry.js +80 -0
  41. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/firefoxAttachServer.js +736 -0
  42. package/dist/services/features/telegram-mcp/src/features/browser-attach/model/types.js +188 -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/sendPartnerFileService.js +6 -3
  45. package/dist/services/features/telegram-mcp/src/features/distributed-client/model/gatewayClientAccess.js +4 -1
  46. package/dist/services/features/telegram-mcp/src/features/distributed-gateway/model/gatewayHttpService.js +33 -35
  47. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileListTool.js +33 -0
  48. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileService.js +327 -0
  49. package/dist/services/features/telegram-mcp/src/features/file-content/model/getFileTool.js +81 -0
  50. package/dist/services/features/telegram-mcp/src/features/file-content/model/temporaryFileLinkStore.js +307 -0
  51. package/dist/services/features/telegram-mcp/src/features/file-content/model/workspaceFilePolicy.js +115 -0
  52. package/dist/services/features/telegram-mcp/src/features/notify/model/notifyService.js +5 -1
  53. package/dist/services/features/telegram-mcp/src/shared/integrations/redis/stateStore.js +28 -0
  54. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transport.js +3 -0
  55. package/dist/services/features/telegram-mcp/src/shared/integrations/telegram/transportFileHandoffActions.js +6 -3
  56. package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/client.js +29 -6
  57. package/dist/services/features/telegram-mcp/src/shared/integrations/terminal/ptyRegistry.js +100 -2
  58. package/dist/services/features/telegram-mcp/src/shared/lib/bodyLimits.js +63 -0
  59. package/dist/services/features/telegram-mcp/src/shared/lib/gatewayAuth.js +13 -0
  60. package/dist/services/features/telegram-mcp/src/shared/lib/time/localTimestamp.js +21 -0
  61. package/docs/CHAT_CONNECTOR.md +134 -0
  62. package/docs/STANDALONE-ru.md +55 -6
  63. package/docs/STANDALONE.md +55 -6
  64. package/package.json +10 -5
  65. package/packages/chrome-attach-extension/dist/background.js +1735 -0
  66. package/packages/chrome-attach-extension/dist/icon.svg +6 -0
  67. package/packages/chrome-attach-extension/dist/manifest.json +37 -0
  68. package/packages/chrome-attach-extension/dist/options.html +312 -0
  69. package/packages/chrome-attach-extension/dist/options.js +606 -0
  70. package/packages/chrome-attach-extension/dist/popup.html +93 -0
  71. package/packages/chrome-attach-extension/dist/popup.js +79 -0
  72. package/packages/chrome-attach-extension/dist/recorder-content.js +96 -0
  73. package/packages/chrome-attach-extension/dist/recorder-page.js +282 -0
  74. package/packages/firefox-attach-extension/README.md +13 -0
  75. package/packages/firefox-attach-extension/dist/background.js +1622 -0
  76. package/packages/firefox-attach-extension/dist/icon.svg +6 -0
  77. package/packages/firefox-attach-extension/dist/manifest.json +44 -0
  78. package/packages/firefox-attach-extension/dist/options.html +312 -0
  79. package/packages/firefox-attach-extension/dist/options.js +540 -0
  80. package/packages/firefox-attach-extension/dist/popup.html +93 -0
  81. package/packages/firefox-attach-extension/dist/popup.js +64 -0
  82. package/packages/firefox-attach-extension/dist/recorder-content.js +90 -0
  83. package/packages/firefox-attach-extension/dist/recorder-page.js +318 -0
package/TOOLS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tools
2
2
 
3
- Version: `2026-05-22.1`
3
+ Version: `2026-06-06.2`
4
4
 
5
5
  Gateway/client runtime compatibility:
6
6
 
@@ -16,10 +16,19 @@ This MCP server currently exposes the following tools.
16
16
 
17
17
  Browser tools:
18
18
 
19
+ - `browser_list_attached_instances`
20
+ - `browser_list_tabs`
21
+ - `browser_attach_active_tab`
22
+ - `browser_attach_tab`
23
+ - `browser_detach_tab`
24
+ - `browser_recording_start`
25
+ - `browser_recording_stop`
26
+ - `browser_recording_status`
19
27
  - `browser_open`
20
28
  - `browser_reload`
21
29
  - `browser_click`
22
30
  - `browser_fill`
31
+ - `browser_inject_script`
23
32
  - `browser_press`
24
33
  - `browser_wait_for`
25
34
  - `browser_wait_for_url`
@@ -34,7 +43,17 @@ Browser tools:
34
43
 
35
44
  Browser runtime rule:
36
45
 
37
- - Browser tools use Playwright Chromium.
46
+ - Browser tools now have two backends:
47
+ - attached browser tab backend for a real user Firefox or Chrome session
48
+ - isolated Playwright Chromium backend
49
+ - `browser_open` is only for the isolated Playwright backend.
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`
52
+ - `browser_recording_start`, `browser_recording_stop`, and `browser_recording_status` are also for the attached browser backend
53
+ - browser recordings are written under `.mcp-xchange/web/{tab-title-slug}-{timestamp}/`
54
+ - each recording bundle contains `session.json`, `timeline.ndjson`, `pages/`, `network/`, and `console/`
55
+ - inside `network/`, use `index.ndjson` as the thin search index and `requests/{seq}-{request_id}/` as the per-request artifact bundle
56
+ - otherwise those tools use the Playwright backend after `browser_open`
38
57
  - If browser tools fail because the Playwright browser runtime is missing, install it with `tellymcp browser install`.
39
58
  - Do not stop at the installation error itself. Install the browser runtime first, then retry the browser tool.
40
59
 
@@ -64,13 +83,16 @@ Collaboration tools:
64
83
 
65
84
  Utility tools:
66
85
 
86
+ - `get_file_list`
87
+ - `get_file`
67
88
  - `refresh_tools_markdown`
68
89
 
69
90
  ## Console model
70
91
 
71
92
  Gateway-first runtime model:
72
93
 
73
- - 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_TOKEN`
74
96
  - Telegram no longer links sessions with pair codes
75
97
  - `/menu` in the gateway bot shows available remote consoles directly
76
98
  - one running agent console is one logical session/console target
@@ -95,7 +117,18 @@ Preferred order for cross-console work:
95
117
  - `send_partner_note`
96
118
  - `send_partner_file`
97
119
  - browser tools
98
- 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.
99
132
 
100
133
  ## `set_session_context`
101
134
 
@@ -174,6 +207,99 @@ Output:
174
207
  - `terminal?`
175
208
  Terminal runtime metadata for the console.
176
209
 
210
+ ## `get_file_list`
211
+
212
+ Purpose:
213
+
214
+ - List managed files available in a selected console workspace before calling `get_file`.
215
+ - Return exact `file_path` values accepted by `get_file`.
216
+
217
+ Input:
218
+
219
+ - `session_id`
220
+ - `source?`
221
+ - `telegram-upload`
222
+ - `browser-screenshot`
223
+ - `partner-artifact`
224
+ - `limit?`
225
+ - default: `50`
226
+ - maximum: `200`
227
+
228
+ Output:
229
+
230
+ - `total`
231
+ - `files[]`
232
+ - `file_path`
233
+ - `filename`
234
+ - `mimetype`
235
+ - `source`
236
+ - `size_bytes?`
237
+ - `created_at`
238
+
239
+ Behavior:
240
+
241
+ - results are ordered newest first
242
+ - `total` is the number of matching managed files before `limit` is applied
243
+ - this tool lists TellyMCP-managed Telegram uploads, browser screenshots, and partner artifacts; it does not recursively enumerate arbitrary source files in the workspace
244
+ - in gateway mode, always pass the canonical `session_id = client_uuid:local_session_id`
245
+ - pass the chosen `files[].file_path` unchanged to `get_file`
246
+
247
+ ## `get_file`
248
+
249
+ Purpose:
250
+
251
+ - Return the actual content of a file from a selected console workspace to an MCP chat client.
252
+ - URL mode creates a bounded temporary gateway copy; text and base64 modes relay content directly.
253
+
254
+ Input:
255
+
256
+ - `session_id`
257
+ - `type?`
258
+ - `url` (default)
259
+ - `image` (native inline image plus download URL)
260
+ - `text` (native UTF-8 MCP text content)
261
+ - `base64` (fallback)
262
+ - exactly one of:
263
+ - `file_path`
264
+ - `selector = "latest_screenshot"`
265
+
266
+ Output:
267
+
268
+ - `type`
269
+ - `data`
270
+ - short-lived HTTPS URL when `type = "url"`
271
+ - short-lived HTTPS URL when `type = "image"`; the actual pixels are in the native MCP image content block
272
+ - decoded UTF-8 file content when `type = "text"`
273
+ - base64 payload when `type = "base64"`
274
+ - `mimetype`
275
+ - `filename`
276
+ - `size_bytes`
277
+ - `expires_at?`
278
+
279
+ Behavior:
280
+
281
+ - in gateway mode, always pass the canonical `session_id = client_uuid:local_session_id` returned by `list_gateway_sessions`
282
+ - `file_path` may be the exact path returned by `browser_screenshot`, so the human does not need to know generated filenames
283
+ - `selector = "latest_screenshot"` selects the newest file metadata with `source = "browser-screenshot"` for that session
284
+ - file reads are limited to the selected console workspace, including after symlink resolution
285
+ - exact project-relative paths such as `README.md` or `src/test.ts` are accepted even though `get_file_list` only discovers managed artifacts
286
+ - text mode returns the decoded file directly as a native MCP text content block and rejects invalid UTF-8 or binary NUL content
287
+ - source extensions such as `.ts` and `.tsx` use text MIME overrides instead of the generic MPEG/octet-stream mappings
288
+ - 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
289
+ - 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
290
+ - 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
291
+ - image mode accepts only `image/*` files up to the safe native-inline limit; use `url` for larger images
292
+ - URL links allow up to three GET downloads; HEAD requests do not consume the limit
293
+ - if URL fetching fails for an image, retry with `type = "image"`
294
+ - 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
295
+ - base64 mode is bounded by the final MCP response body limit
296
+ - do not attempt to bypass the sensitive-file policy or retrieve renamed secrets
297
+
298
+ Screenshot examples:
299
+
300
+ - "take a screenshot and send it": call `browser_screenshot`, then pass its returned `file_path` to `get_file`
301
+ - "send the latest screenshot": call `get_file` with `selector = "latest_screenshot"`
302
+
177
303
  ## `refresh_tools_markdown`
178
304
 
179
305
  Purpose:
@@ -431,7 +557,7 @@ Required agent practice:
431
557
  - "tell frontend what changed"
432
558
  - "send the error to your teammate"
433
559
  - "tell the other agent what's new"
434
- then the correct path is `send_partner_note`
560
+ then the correct path is `send_partner_note`
435
561
 
436
562
  How to find the partner correctly:
437
563
 
@@ -491,7 +617,7 @@ Reply rule for project asks:
491
617
  - `Reply project_uuid: ...`
492
618
  - `Reply target_client_uuid: ...`
493
619
  - `Reply target_local_session_id: ...`
494
- or a `Reply Params` section with the same data
620
+ or a `Reply Params` section with the same data
495
621
  - then reply with those exact values
496
622
  - if `in_reply_to` is available, prefer `Reply message_uuid`
497
623
  - if only the note `share_id` is available, gateway now also accepts that value in `in_reply_to`
@@ -592,7 +718,7 @@ How the receiving agent must react:
592
718
  - `проверь xchange records`
593
719
  - `telegram_message`
594
720
  - `partner_note`
595
- then do not start with a legacy inbox-specific tool
721
+ then do not start with a legacy inbox-specific tool
596
722
  - instead:
597
723
  1. call `list_xchange_records`
598
724
  2. identify the newest relevant record by category:
@@ -758,7 +884,8 @@ Output:
758
884
  Notes:
759
885
 
760
886
  - each session gets its own isolated browser context and page
761
- - call this first before reading console, DOM, styles, or screenshots
887
+ - call this first only when you want the isolated Playwright backend
888
+ - do not call this just to work with an already selected Firefox attached tab
762
889
  - `url` may be an absolute URL, or a relative path when `BROWSER_ADDRESS` is configured
763
890
  - in headed mode the browser window is started maximized by default
764
891
  - in headed mode a fresh browser context is created without a fixed viewport unless you explicitly pass `width` and `height`
@@ -766,6 +893,206 @@ Notes:
766
893
  - if you pass viewport size, pass both `width` and `height` together
767
894
  - use explicit `width` and `height` when the task depends on a specific responsive breakpoint or working area
768
895
 
896
+ ## `browser_list_attached_instances`
897
+
898
+ Purpose:
899
+
900
+ - list browser instances currently connected through the local attach extension bridge
901
+
902
+ Input:
903
+
904
+ - `session_id?`
905
+
906
+ Output:
907
+
908
+ - `session_id?`
909
+ - `total`
910
+ - `instances[]`
911
+ - `instance_id`
912
+ - `browser`
913
+ - `extension_version`
914
+ - `profile_name?`
915
+ - `connected_at`
916
+ - `last_seen_at`
917
+ - `capabilities[]`
918
+ - `tab_count`
919
+ - `active_tab?`
920
+
921
+ ## `browser_list_tabs`
922
+
923
+ Purpose:
924
+
925
+ - list tabs from an attached browser instance
926
+
927
+ Input:
928
+
929
+ - `session_id?`
930
+ - `instance_id?`
931
+
932
+ Output:
933
+
934
+ - `session_id?`
935
+ - `instance_id`
936
+ - `total`
937
+ - `tabs[]`
938
+ - `tab_id`
939
+ - `window_id?`
940
+ - `active`
941
+ - `selected?`
942
+ - `title`
943
+ - `url`
944
+ - `status?`
945
+
946
+ Notes:
947
+
948
+ - if only one attached browser instance is connected, `instance_id` can be omitted
949
+ - 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`
950
+ - `active=true` means the tab is active in its browser window; there may be more than one such tab across multiple windows
951
+ - for the tab currently selected for this MCP session, prefer `selected=true`
952
+
953
+ ## `browser_attach_active_tab`
954
+
955
+ Purpose:
956
+
957
+ - attach the current MCP session to the active tab of a connected attached browser instance
958
+
959
+ Input:
960
+
961
+ - `session_id?`
962
+ - `instance_id?`
963
+
964
+ Output:
965
+
966
+ - `session_id`
967
+ - `backend`
968
+ - `instance_id`
969
+ - `tab_id`
970
+ - `attached_at`
971
+ - `title?`
972
+ - `url?`
973
+
974
+ ## `browser_attach_tab`
975
+
976
+ Purpose:
977
+
978
+ - attach the current MCP session to a specific attached browser tab by `tab_id`
979
+
980
+ Input:
981
+
982
+ - `session_id?`
983
+ - `instance_id?`
984
+ - `tab_id`
985
+
986
+ Output:
987
+
988
+ - `session_id`
989
+ - `backend`
990
+ - `instance_id`
991
+ - `tab_id`
992
+ - `attached_at`
993
+ - `title?`
994
+ - `url?`
995
+
996
+ ## `browser_detach_tab`
997
+
998
+ Purpose:
999
+
1000
+ - detach the current MCP session from the currently selected attached browser tab
1001
+
1002
+ Input:
1003
+
1004
+ - `session_id?`
1005
+
1006
+ Output:
1007
+
1008
+ - `session_id`
1009
+ - `detached`
1010
+
1011
+ ## `browser_recording_start`
1012
+
1013
+ Purpose:
1014
+
1015
+ - start a structured browser recording bundle for the attached browser tab currently selected for this MCP session
1016
+
1017
+ Input:
1018
+
1019
+ - `session_id?`
1020
+ - `instance_id?`
1021
+
1022
+ Output:
1023
+
1024
+ - `session_id`
1025
+ - `backend`
1026
+ - `started`
1027
+ - `recording_id`
1028
+ - `instance_id`
1029
+ - `tab_id`
1030
+ - `tab_title?`
1031
+ - `tab_url?`
1032
+ - `bundle_dir_name`
1033
+ - `bundle_relative_path`
1034
+ - `bundle_path`
1035
+ - `started_at`
1036
+
1037
+ Notes:
1038
+
1039
+ - this works only with the attached browser backend, not Playwright
1040
+ - select the target tab first from the browser extension control panel
1041
+ - the bundle is created under `.mcp-xchange/web/{tab-title-slug}-{timestamp}/`
1042
+ - the recording captures page snapshots, console events, request metadata, headers, cookies snapshots, and available request/response bodies
1043
+ - for network analysis, read `network/index.ndjson` first, then open the matching `network/requests/{seq}-{request_id}/meta.json`
1044
+ - use `request.json`, `response.json`, and optional body files only when deeper detail is needed
1045
+
1046
+ ## `browser_recording_stop`
1047
+
1048
+ Purpose:
1049
+
1050
+ - stop the active structured browser recording for this MCP session
1051
+
1052
+ Input:
1053
+
1054
+ - `session_id?`
1055
+
1056
+ Output:
1057
+
1058
+ - `session_id`
1059
+ - `stopped`
1060
+ - `recording_id?`
1061
+ - `bundle_dir_name?`
1062
+ - `bundle_relative_path?`
1063
+ - `bundle_path?`
1064
+ - `stopped_at?`
1065
+
1066
+ ## `browser_recording_status`
1067
+
1068
+ Purpose:
1069
+
1070
+ - inspect whether a structured browser recording is active and where its bundle is being written
1071
+
1072
+ Input:
1073
+
1074
+ - `session_id?`
1075
+
1076
+ Output:
1077
+
1078
+ - `session_id`
1079
+ - `active`
1080
+ - `recording?`
1081
+ - `backend`
1082
+ - `recording_id`
1083
+ - `instance_id`
1084
+ - `tab_id`
1085
+ - `tab_title?`
1086
+ - `tab_url?`
1087
+ - `bundle_dir_name`
1088
+ - `bundle_relative_path`
1089
+ - `bundle_path`
1090
+ - `started_at`
1091
+ - `stopped_at?`
1092
+ - `status`
1093
+ - `event_count`
1094
+ - `last_event_at?`
1095
+
769
1096
  ## `browser_console`
770
1097
 
771
1098
  Purpose:
@@ -806,6 +1133,8 @@ Output:
806
1133
  Purpose:
807
1134
 
808
1135
  - click an element in the current session page
1136
+ - if the session has a selected attached browser tab, click there
1137
+ - otherwise click in the isolated Playwright page
809
1138
 
810
1139
  Input:
811
1140
 
@@ -831,6 +1160,8 @@ Output:
831
1160
  Purpose:
832
1161
 
833
1162
  - fill an input or textarea in the current session page
1163
+ - if the session has a selected attached browser tab, fill there
1164
+ - otherwise fill in the isolated Playwright page
834
1165
 
835
1166
  Input:
836
1167
 
@@ -858,6 +1189,8 @@ Output:
858
1189
  Purpose:
859
1190
 
860
1191
  - send a key press to the page or a targeted element
1192
+ - if the session has a selected attached browser tab, press there
1193
+ - otherwise press in the isolated Playwright page
861
1194
 
862
1195
  Input:
863
1196
 
@@ -880,6 +1213,38 @@ Output:
880
1213
  - `url`
881
1214
  - `title?`
882
1215
 
1216
+ ## `browser_inject_script`
1217
+
1218
+ Purpose:
1219
+
1220
+ - inject JavaScript into the current session browser target
1221
+ - if the session has a selected attached browser tab, inject into that real browser tab
1222
+ - otherwise inject into the isolated Playwright page
1223
+ - the script is wrapped so `window[namespace]` exists; default namespace is `TELLY`
1224
+
1225
+ Input:
1226
+
1227
+ - `session_id?`
1228
+ - `source?`
1229
+ - `file_path?`
1230
+ - `namespace?`
1231
+
1232
+ Rules:
1233
+
1234
+ - provide either `source` or `file_path`
1235
+ - prefer `file_path` for local reusable scripts and larger payloads
1236
+ - injected scripts can use both `window.TELLY` and local `TELLY` when `namespace` is left at the default
1237
+
1238
+ Output:
1239
+
1240
+ - `session_id`
1241
+ - `injected`
1242
+ - `namespace`
1243
+ - `source_type`
1244
+ - `bytes`
1245
+ - `url`
1246
+ - `title?`
1247
+
883
1248
  ## `browser_wait_for`
884
1249
 
885
1250
  Purpose:
@@ -921,6 +1286,7 @@ Browser target rules for `browser_click`, `browser_fill`, `browser_press`, `brow
921
1286
  - `div[data-testid="save"]`
922
1287
  - use `text` only when there is no reliable selector
923
1288
  - do not mix ambiguous hashed CSS classes with fuzzy text guessing when a stable selector exists
1289
+ - for the attached browser backend, prefer `selector` first; `ai_tag` and `text` still work, but the attach executor is intentionally lighter than full Playwright
924
1290
 
925
1291
  ## `browser_wait_for_url`
926
1292
 
@@ -1002,6 +1368,8 @@ Output:
1002
1368
  Purpose:
1003
1369
 
1004
1370
  - inspect a DOM element in the session browser tab
1371
+ - if the session has a selected attached browser tab, inspect that real browser tab
1372
+ - otherwise inspect the isolated Playwright page
1005
1373
 
1006
1374
  Input:
1007
1375
 
@@ -1027,6 +1395,8 @@ Output:
1027
1395
  Purpose:
1028
1396
 
1029
1397
  - inspect computed styles and box metrics for a DOM element in the session browser tab
1398
+ - if the session has a selected attached browser tab, inspect that real browser tab
1399
+ - otherwise inspect the isolated Playwright page
1030
1400
 
1031
1401
  Input:
1032
1402
 
@@ -1050,6 +1420,8 @@ Output:
1050
1420
  Purpose:
1051
1421
 
1052
1422
  - capture a screenshot from the session browser tab
1423
+ - if the session has a selected attached browser tab, capture from that real browser tab
1424
+ - otherwise capture from the isolated Playwright page
1053
1425
 
1054
1426
  Input:
1055
1427
 
@@ -1076,12 +1448,15 @@ Notes:
1076
1448
  - they are tracked separately from Telegram-uploaded files
1077
1449
  - they appear under Telegram `Browser -> Screenshots`
1078
1450
  - if `send_to_telegram=true`, the saved screenshot is also sent into the bound Telegram chat for that session
1451
+ - for the attached browser backend, the screenshot comes from the selected tab in the user browser session
1079
1452
 
1080
1453
  ## `browser_close`
1081
1454
 
1082
1455
  Purpose:
1083
1456
 
1084
- - close the isolated browser context for the current session
1457
+ - close the current browser target for the session
1458
+ - if the session has a selected attached browser tab, close that real browser tab and clear the attach state
1459
+ - otherwise close the isolated Playwright browser context
1085
1460
 
1086
1461
  Input:
1087
1462
 
@@ -29,13 +29,27 @@ MCP_HTTP_PATH=/mcp
29
29
  MCP_HTTP_ENABLE_DEBUG_ROUTES=false
30
30
  MCP_HTTP_ENABLE_PRUNE_ROUTE=false
31
31
 
32
+ # ChatGPT / Claude OAuth connector. Setting any OAuth value enables the facade.
33
+ # TELLYMCP_PUBLIC_URL=https://your-domain.example/api
34
+ # TELLYMCP_OAUTH_ISSUER=https://your-domain.example/api
35
+ # TELLYMCP_OAUTH_AUDIENCE=https://your-domain.example/api
36
+ # TELLYMCP_MAGIC_TOKEN=change_me_private_connector_token
37
+ # TELLYMCP_MAGIC_TOKEN_HASH=sha256:<hex>
38
+ # TELLYMCP_OAUTH_CLIENT_ID=tellymcp
39
+ # TELLYMCP_OAUTH_CLIENT_SECRET=
40
+ # TELLYMCP_ALLOWED_REDIRECT_URIS=https://chatgpt.com/connector/oauth/...,https://claude.ai/api/mcp/auth_callback
41
+ # TELLYMCP_OAUTH_PRIVATE_KEY_PEM="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
42
+ # TELLYMCP_AUTH_CODE_TTL_SECONDS=300
43
+ # TELLYMCP_OAUTH_SCOPES=tellymcp:read tellymcp:write
44
+ # TELLYMCP_OAUTH_KEY_ID=tellymcp-oauth
45
+
32
46
  DISTRIBUTED_MODE=both
33
47
  GATEWAY_PUBLIC_URL=
34
48
  GATEWAY_WS_URL=
35
49
  GATEWAY_WS_PATH=/api/gateway/ws
36
50
  GATEWAY_TOKEN=
37
51
  GATEWAY_USER_UUID=
38
- # GATEWAY_AUTH_TOKEN=
52
+ GATEWAY_AUTH_TOKEN=
39
53
 
40
54
  ROOT_PREFIX=/api
41
55
  PORT=8080
@@ -63,7 +77,6 @@ WEBAPP_INITDATA_TTL_SECONDS=300
63
77
  WEBAPP_SESSION_TTL_SECONDS=900
64
78
  WEBAPP_LAUNCH_MODE=fullscreen
65
79
  WEBAPP_VISIBLE_SCREENS=10
66
- WEBAPP_POLL_INTERVAL_MS=2000
67
80
  WEBAPP_ACTION_COOLDOWN_MS=150
68
81
 
69
82
  MCP_XCHANGE_DIR=.mcp-xchange
@@ -24,7 +24,7 @@ GATEWAY_WS_URL=
24
24
  GATEWAY_WS_PATH=/api/gateway/ws
25
25
  GATEWAY_TOKEN=
26
26
  GATEWAY_USER_UUID=
27
- # GATEWAY_AUTH_TOKEN=
27
+ GATEWAY_AUTH_TOKEN=
28
28
 
29
29
  TERMINAL_SHELL=bash
30
30
  TERMINAL_COLS=120
@@ -51,7 +51,6 @@ WEBAPP_INITDATA_TTL_SECONDS=300
51
51
  WEBAPP_SESSION_TTL_SECONDS=900
52
52
  WEBAPP_LAUNCH_MODE=fullscreen
53
53
  WEBAPP_VISIBLE_SCREENS=10
54
- WEBAPP_POLL_INTERVAL_MS=2000
55
54
  WEBAPP_ACTION_COOLDOWN_MS=150
56
55
 
57
56
  MCP_XCHANGE_DIR=.mcp-xchange
@@ -66,6 +65,10 @@ BROWSER_WAIT_UNTIL=load
66
65
  # BROWSER_EXECUTABLE_PATH=
67
66
  # BROWSER_CHANNEL=chrome
68
67
  BROWSER_SLOW_MO_MS=0
68
+ # BROWSER_ATTACH_ENABLED=true
69
+ # BROWSER_ATTACH_WS_HOST=127.0.0.1
70
+ # BROWSER_ATTACH_WS_PORT=9999
71
+ # BROWSER_ATTACH_WS_PATH=/browser-attach/ws
69
72
 
70
73
  NAMESPACE=mcp
71
74
  NODE_ID=agent
@@ -25,12 +25,26 @@ MCP_HTTP_PATH=/mcp
25
25
  MCP_HTTP_ENABLE_DEBUG_ROUTES=false
26
26
  MCP_HTTP_ENABLE_PRUNE_ROUTE=false
27
27
 
28
+ # ChatGPT / Claude OAuth connector. Setting any OAuth value enables the facade.
29
+ # TELLYMCP_PUBLIC_URL=https://your-domain.example/api
30
+ # TELLYMCP_OAUTH_ISSUER=https://your-domain.example/api
31
+ # TELLYMCP_OAUTH_AUDIENCE=https://your-domain.example/api
32
+ # TELLYMCP_MAGIC_TOKEN=change_me_private_connector_token
33
+ # TELLYMCP_MAGIC_TOKEN_HASH=sha256:<hex>
34
+ # TELLYMCP_OAUTH_CLIENT_ID=tellymcp
35
+ # TELLYMCP_OAUTH_CLIENT_SECRET=
36
+ # TELLYMCP_ALLOWED_REDIRECT_URIS=https://chatgpt.com/connector/oauth/...,https://claude.ai/api/mcp/auth_callback
37
+ # TELLYMCP_OAUTH_PRIVATE_KEY_PEM="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
38
+ # TELLYMCP_AUTH_CODE_TTL_SECONDS=300
39
+ # TELLYMCP_OAUTH_SCOPES=tellymcp:read tellymcp:write
40
+ # TELLYMCP_OAUTH_KEY_ID=tellymcp-oauth
41
+
28
42
  DISTRIBUTED_MODE=gateway
29
43
  GATEWAY_PUBLIC_URL=
30
44
  GATEWAY_WS_URL=
31
45
  GATEWAY_WS_PATH=/api/gateway/ws
32
46
  GATEWAY_TOKEN=
33
- # GATEWAY_AUTH_TOKEN=
47
+ GATEWAY_AUTH_TOKEN=
34
48
 
35
49
  ROOT_PREFIX=/api
36
50
  PORT=8080
@@ -58,7 +72,6 @@ WEBAPP_INITDATA_TTL_SECONDS=300
58
72
  WEBAPP_SESSION_TTL_SECONDS=900
59
73
  WEBAPP_LAUNCH_MODE=fullscreen
60
74
  WEBAPP_VISIBLE_SCREENS=10
61
- WEBAPP_POLL_INTERVAL_MS=2000
62
75
  WEBAPP_ACTION_COOLDOWN_MS=150
63
76
 
64
77
  MCP_XCHANGE_DIR=.mcp-xchange