GooDAnDReaDY / @goodandready/dsh-messenger-gateway
Telegram messenger bridge for DeepSeek Harness: sessions, steer, homes, inline asks, notify bridge, and optional TTS voice notes.
About this plugin
Written by the registry from verified metadata, not from the README.
@goodandready/dsh-messenger-gateway is a DSH plugin published from the GooDAnDReaDY/dsh-messenger-gateway repository.
Capabilities and topics
📦 @goodandready/dsh-messenger-gateway
⚡ Overview
dsh-messenger-gateway provides an enterprise-grade, multi-transport messaging gateway for DeepSeek Harness agents.
Talk to your Harness agent directly from Telegram: interactive keyboard buttons, forum topic sessions, private user workspaces, pairing codes, and optional spoken voice replies.
Talk to your Harness agent from Telegram: text, voice, photos, documents, inline buttons, named homes, and optional spoken replies.
Features
- Long-poll or webhook Telegram bot
- Configurable proxy support: HTTP, HTTPS, SOCKS5, and SOCKS5h (
telegram.proxyUrl) - Custom Bot API root URL (
telegram.apiRoot) for reverse proxies and local Bot API servers - Multi-transport support: Telegram (bidirectional), Discord and Slack (send-only outbound)
- Allowlist + pairing codes (fail-closed by default: a fresh install admits nobody until paired;
allowlistMode: openis an explicit opt-in) - Conversation switching directly from chat (
/sessionsand/resume <n|id>) - Per-user or per-chat sessions (
sessionScope) - Forum topics as separate sessions
- Named sessions from chat metadata (
agent.sessionTitleFromChat:TG · @usernameorTG · Group › topic N) - Quick actions reply keyboard (
/keyboard on|off) - Multi-select interactive ask forms with checkboxes and pagination (
messenger_ask) - Artifact & Mermaid diagram rendering (SVG cards) and monospace table formatting
- Agent roles & personas (
/role coder,/role architect,@roletags in group chats) - Agent tools & skills inspection (
/skills,/tools) - Session management: dialogue history export to Markdown (
/export), turn rewind (/rewind), session branching (/fork) - Workspace file manager (
/files [dir]) and file download (/get <path>) with directory traversal protection - Admin alert channel for pairing requests, model errors and monitoring (
/setalert,/alert) - Persistent scheduled reminders (
/remind <time> <text>,/remind list,/remind cancel) - Inbound webhook event dispatcher (
POST /dsh-messenger-gateway/events) for CI/CD and external alerts - Steer: follow-up messages while the agent is busy (instead of aborting)
/stop,/new,/model,/status,/voice,/sethome,/home- Agent tool
messenger_ask(inline keyboard answers return to the agent) - Named homes for outbound notify /
messenger.send - Optional notify bridge: web session events → Telegram home (excludes messenger sessions)
- Inbound voice → STT (
dsh-voice), photos → vision (dsh-vision-bridge) - Optional TTS replies (
dsh-tts); mp3 is converted to OGG/Opus viaffmpegfor Telegram voice notes
Discord and Slack adapters are available as outbound transports (Webhooks or Bot REST APIs). They are send-only (#236): there is no inbound path, so interactive features (messenger_ask, approval cards) are unavailable there and /status labels these adapters as send-only. Telegram is the only bidirectional transport.
Install
dsh plugin --profile web add @goodandready/dsh-messenger-gateway
Then open Settings → Plugins → Messenger gateway:
- Enable Telegram
- Paste the BotFather token (write-only; leave blank to keep the current token)
- Set allowed Telegram user IDs (or use pairing)
Optional companion plugins (same profile)
| Plugin | Role |
|---|---|
@goodandready/dsh-voice | Transcribe inbound voice messages |
@goodandready/dsh-tts | Speak agent replies |
@goodandready/dsh-vision-bridge | Describe inbound photos |
They are not npm dependencies of this package — install them separately if you want those features.
Voice notes
Spoken replies use Telegram sendVoice. If TTS returns MP3 (or other non-Opus audio), the gateway runs ffmpeg (libopus) to produce OGG. If ffmpeg is missing or conversion fails, the audio is sent as a regular audio file instead of a voice note.
Commands (Telegram)
The command surface is driven by a single registry (COMMAND_REGISTRY in lib/commands.js) — /help and the Telegram autocomplete list are derived from it, so the table below is always in sync.
| Command | Description |
|---|---|
/help | Show commands help |
/new | Start a fresh session |
/sessions | List recent conversations |
/resume <n|id> | Switch chat to a previous session |
/stop | Interrupt the current response |
/model [list|<prov> <mod>] | Interactive model selector |
/role [name] | Switch persona or role (/role list) |
/bind [role] | Bind persona to topic / chat |
/preset [name] | Bind preset to topic / chat |
/lang [en|zh] | Switch user language |
/rewind [N] | Rewind last N turns |
/fork | Fork the session into a new branch |
/export | Export history to Markdown |
/skills | List active tools & skills |
/tools | List active tools |
/project | Topic workspace binding (/project bind <path>) |
/memory [add <fact>] | Show / add remembered user facts |
/forget <id|all> | Delete stored user facts |
/outbox [retry|clear] | Transactional queue & DLQ |
/cost | Session token usage & estimated cost |
/cwd | Show the working directory |
/files [dir] | Workspace file explorer |
/get <path> | Download a file to the chat |
/remind <time> <text> | Set a reminder (e.g. /remind 15m Call client) |
/cron | Manage recurring autonomous tasks |
/topic <name> | Create a forum topic with an isolated session |
/status | Gateway and active model status |
/top | Live server resources: RAM, uptime, chats |
/app, /dashboard | Open the Mini App dashboard |
/keyboard on|off | Toggle the quick-actions keyboard |
/voice on|off | Per-user spoken replies |
/tts on|off|status | Per-chat speech synthesis |
/mute / /unmute | Mute / unmute notifications in this chat |
/update [now] | Check or install a plugin update |
/start | Connect and show greeting |
/whoami | Your messenger user id |
/pair CODE | Approve a pairing code |
/sethome [name] | Bind the current chat/topic as a named home |
/home | List homes |
/setalert | Configure the admin alert channel |
/alert [test] | Alert channel status / test alert |
Multi-Transport Support (Discord & Slack)
In addition to Telegram, outbound messages can be dispatched to Discord and Slack via Webhooks or Bot APIs:
- Discord: set
discord.enabled: true, provide eitherwebhookUrlorbotToken. Target channels viachatId: "<channel_id>". - Slack: set
slack.enabled: true, provide eitherwebhookUrlorbotToken. Target channels viachatId: "<channel_id>"or threads viathreadId: "<thread_ts>".
Send-only transports (#236): Discord and Slack have no inbound path (no interactions endpoint / events API), so they deliver notifications and replies but cannot receive button clicks.
messenger_askand approval cards are not offered on these transports (requests fail fast), and/status+ the web dashboard label them assend-only.
Agent tools & HTTP
- Tool:
messenger_ask— ask the user with inline buttons; choice is fed back into the turn - HTTP (when enabled):
/messenger/send,/messenger/ask,/messenger/progress - Cordis service:
ctx.messengerfor other plugins
Configuration notes
sessionScope:user(default) orchat— how group chats isolate sessionsallowlistMode:closed(default) oropen— closed refuses every unknown user (fail-closed): a fresh install admits nobody until the admin approves a pairing code (/start→ approve in the settings card); open admits all users when the allowlist is empty — enable it explicitly only for public assistant bots, the settings card and/statussurface the exposuresecurity.trustProxy:false(default) — loopback-trusted requests must carry a pinnedlocalhost/127.0.0.1/[::1]Host (DNS rebinding defense). Enable only behind a trusted local reverse proxy that rewrites the Host header/getand/filesrequire allowlisted users and never serve hidden (dot) filestelegram.proxyUrlis a secret: the settings API returns only a masked value and an empty field keeps the configured proxy- Inbound archives are extraction-capped (per-entry and per-archive budget verified against actual bytes — a lying ZIP header cannot balloon the heap)
- Mini App artifacts are chat-scoped: a Telegram user sees only artifacts produced in their own chat; allowlisted admins see all
- Mini App sign-in is hardened:
auth_daterequired, 1h acceptance window, one-timequery_id(replays rejected);initDatain URL query is not accepted — the Mini App must send it via theAuthorization: tmaheader - HITL approvals are fail-closed by default: in
mutationssensitivity every tool that is not recognizably read-only (including network, send and MCP tools) asks for confirmation; a chat without a target refuses unconfirmed actions - Delivered updates are deduplicated across polling and webhook transports and the poll offset survives restarts — commands never execute twice
- Artifact SVG entering the dashboard store is sanitized (script blocks, event handlers and
javascript:URLs stripped) - Pending interactive asks are bounded (200 concurrent) and the ask timeout is clamped to 10 minutes
- Long replies are chunked by raw markdown (fence-aware) so no HTML tag is ever cut at a message boundary;
/voice summaryand/keyboardpersist through the settings writer telegram.apiRootwith plainhttpis only accepted for loopback hosts (a local Bot API server); the webhook URL is logged without its secret pathwebhooks.enabled: falseremoves the messenger write routes entirely; GET/updateand/messengerrequire trusted callerswebAppEnabled: falsetakes the whole Mini App surface down (dashboard and every/api/*answer 404) and clears the menu button- The outbox queue (alerts, cron, autonomous messages) is multi-writer safe: all mutations take an exclusive lock and reload on-disk state, so two gateway processes sharing a home neither lose nor duplicate jobs; DLQ alerts bypass the queue and are rate-limited per chat
- Note: turn replies to the user are streamed directly and are not covered by the outbox retry guarantee (by design — streaming edits cannot be replayed)
- Inline keyboard
replyMarkupsent via/messenger/sendis schema-validated (button text/actions, sizes) before delivery - All state files (pairing, outbox, voice prefs) are written with
0600permissions inside0700directories - State persistence is durable and versioned: every write is fsynced before the rename (directory fsynced after), each save keeps a
.bakof the previous good version, files carry aschemaVersionwith migrations from legacy formats, and a corrupted file is preserved as.corrupt-<ts>and recovered from.bak— pairing never silently wipes access (fail-closed with an explicit error) - Config sync is granular: changes that do not touch the transport slice (tokens, proxy, Bot API root, poll/webhook mode, adapter enablement, session scope) are applied live on the running gateway — active dialogs, streaming replies, pending asks and the Telegram polling offset survive a settings save; only transport changes recreate the gateway, and recreation is serialized (single-flight)
- Hot path stays async: cwd resolution is cached (10 s TTL) so inbound messages never run synchronous
stat/realpath(matters on network filesystems), outbox persistence batches enqueue bursts into one debounced write and is forced out onstop(); the plugin also loads cleanly into profiles without a webServer service (routes are skipped with a warning), and a reload/dispose never leaves a stopped gateway reachable /mute(per chat) stops ALL outbound delivery to that chat — notify bridge,messenger.send, HTTP sends, cron prompts and forum mirroring report{ok, muted}and skip delivery; the interactive turn conversation is unaffected, and the dashboard shows real outbox/DLQ counters- The settings card is generated from the config schema: every setting is visible and editable (the advanced section covers allowlist mode, bot language, approval sensitivity, streaming, Mini App, cost footer, budget alerts, forum mirror and memory injection), secrets are only reported as configured-flags and never returned to the browser
sessionList:true(default) — enables/sessionsand/resumecommands in chatsessionTitleFromChat:false(default) — name each new session after its originating chat (TG · @user,TG · Group › topic N) instead of generic generated titlesvoiceMode:mirror/always/off— when to speak replies (also/voice)tts.enabled/tts.maxChars— TTS gate and length capnotifyBridge— forward non-messenger web session events to a hometelegram.proxyUrl: optional HTTP, HTTPS or SOCKS5 proxy URL (socks5://user:pass@127.0.0.1:1080,http://127.0.0.1:8080);socks://andsocks5h://are aliases. Leave it empty to useTELEGRAM_PROXY/DSH_MESSENGER_TELEGRAM_PROXY/HTTPS_PROXY/ALL_PROXYfrom the environment, useoff/none/directto disable proxying entirely, andNO_PROXY/no_proxyrules are honoured. The tunnel is implemented withnode:net/node:tls(no extra dependencies) and keeps normal TLS certificate verification forapi.telegram.orgtelegram.apiRoot: optional custom Telegram Bot API base URL (default:https://api.telegram.org), for local Bot API servers or reverse proxies- Bot token is a DSH secret field — never commit it
Client UI & Settings Card
- Mounted on the Plugins tab: a summary row (
plugins.row.config) and the full settings page (plugins.item), with the legacysettings.plugin.itemslot kept as a fallback for older DSH builds. - Configuration is managed reactively via
settingsScope.bind({ namespace: 'dsh-messenger-gateway' })with snapshot status checking (loading,unavailable,ready). - Protected dictionary registration: duplicate registration attempts on page reload are safely caught with non-fatal warnings, ensuring the settings card never fails to mount.
Requirements
- DeepSeek Harness web (or compatible) profile
- Node.js matching your Harness install
- For voice notes from non-Opus TTS:
ffmpegon the hostPATH
License
MIT
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/GooDAnDReaDY/dsh-messenger-gateway)