congchuanling-dot/DSH-Telegram-Relay 预览 preview

congchuanling-dot/DSH-Telegram-Relay

DSH Relay 让你可以通过 Telegram 远程与 DeepSeek Harness 对话,并接收通知。DSH Relay 将 Telegram 转变为 DeepSeek Harness 的远程对话和通知渠道。

Project Overview项目介绍

This is a native DeepSeek Harness plugin that turns Telegram into a mobile entry point for DSH conversations. It receives private text messages via long polling from the Telegram Bot API, which means you do not need a public static IP or domain, nor do you need to configure a webhook to use the plugin. Messages are passed to the DSH Agent for processing, and the final response is sent back to the original Telegram chat automatically. Each unique Telegram chat ID maps directly to a persistent DSH session, so conversation context is retained across follow-up questions and application restarts.

To get started, you first need to create a new bot by messaging @BotFather on Telegram, then save the generated bot token and retrieve your private chat ID via the getUpdates API endpoint. Next, you configure the token and allowed chat IDs as environment variables, which can be saved to a .env file in your DeepSeek Harness root directory to avoid reconfiguring them every time you launch the app. After configuring the variables, you install dependencies with pnpm, build the plugin, add it to your DSH web profile, and launch DSH from the same terminal that holds your environment variables.

The plugin is released under the open-source Apache 2.0 license, and currently only supports Telegram private text conversations. Additional features like proactive notifications, group chats, media messages, and webhook support are planned for future development. It includes multiple security boundaries: only whitelisted chats can access DSH, sensitive data like tokens and message content is never logged, and errors do not expose local system paths or stack traces to end users. The plugin guarantees at-least-once message delivery, but does not promise exactly-once processing.

这是专为DeepSeek Harness开发的原生插件,可将Telegram作为DSH的移动端对话入口。插件通过Telegram Bot API长轮询接收私聊文本,将消息交给DSH Agent处理后,再把最终回答返回原会话。每个Telegram chat_id对应一个持久化DSH会话,连续追问和进程重启后都能保留对话上下文,同时支持安全访问控制和长文本自动分片。

要使用本插件,你首先需要通过 @BotFather 在Telegram创建机器人,获取Bot Token和你的私聊chat_id,然后将这两个信息配置为环境变量,推荐写入DeepSeek Harness根目录的.env文件,避免每次启动重新配置。接着需要安装依赖、构建插件,再将插件添加到DSH的web配置文件中,最后在配置好环境变量的同个终端启动DSH就可以使用了。

本插件遵循Apache 2.0开源协议,目前仅支持Telegram私聊文本对话,主动通知、群聊、多媒体消息和Webhook将作为后续功能开发。插件会对未授权聊天进行拦截,不记录敏感信息,处理失败时也不会暴露本机路径和调用栈,保证使用安全。当前版本提供至少一次消息交付,不保证严格不重复处理。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add \

把 congchuanling-dot/DSH-Telegram-Relay 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

DSH Telegram Relay

让 Telegram 成为 DeepSeek Harness 的移动端对话入口。

插件在本机通过 Telegram Bot API 长轮询接收私聊文本,将消息交给 DSH Agent 处理,并把最终回答发送回原会话。每个 Telegram chat_id 对应一个持久化 DSH Session,因此连续追问和进程重启后都能保留上下文。

效果展示

同一条对话由 DSH Session 持久化管理。Telegram 负责移动端收发,Web UI 可查看同一套 Agent 能力和执行过程。

Telegram Bot 对话效果 DeepSeek Harness Web 会话效果
Telegram 移动端 DeepSeek Harness Web

核心能力

能力 实现
Telegram 私聊入口 使用 getUpdates 长轮询,无需公网 IP、域名或 Webhook
DSH 完整能力 消息进入真实 DSH Agent,可使用当前 profile 已启用的模型和工具
连续上下文 String(chat_id) 直接作为 DSH Session ID
重启恢复 从 DSH Session persistence 恢复历史对话
安全访问 只允许显式配置在 allowlist 中的私聊
Update 去重 成功回复后原子持久化 Telegram offset
长文本回复 按 Telegram 4096 字符限制进行 Unicode 安全分片
生命周期管理 插件卸载时中止 polling,并释放本插件持有的 Agent

工作原理

Telegram 用户
      │
      │ 私聊文本
      ▼
Telegram Bot API
      │ getUpdates 长轮询
      ▼
DSH Telegram Relay
      │ allowlist 校验
      │ chat_id -> Session ID
      ▼
DeepSeek Harness Agent
      │ 模型推理 / 工具调用 / Session 持久化
      ▼
DSH Telegram Relay
      │ sendMessage
      ▼
Telegram 用户

等待 getUpdates 返回时使用异步网络 I/O,不会通过 CPU 忙等持续轮询。

快速开始

1. 准备 Bot

  1. 在 Telegram 联系 @BotFather。
  2. 执行 /newbot 创建 Bot。
  3. 保存 Bot Token。
  4. 给新 Bot 发送一条消息,并通过 getUpdates 查询自己的私聊 chat_id。
node -e 'fetch(`https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/getUpdates`).then(r => r.json()).then(x => console.dir(x, { depth: null }))'

结果中的 message.chat.id 就是 allowlist 所需的 chat_id。

2. 配置环境变量

Token 和 allowlist 只通过环境变量传入。不要将 Token 写入代码、YAML、README 或 Git。

export TELEGRAM_BOT_TOKEN='<BotFather 返回的 Token>'
export TELEGRAM_ALLOWED_CHAT_IDS='<你的私聊 chat_id>'

允许多个私聊时使用英文逗号分隔:

export TELEGRAM_ALLOWED_CHAT_IDS='123456789,987654321'

export 只对当前终端会话及其启动的子进程生效。关闭终端或新开终端后,需要重新设置。Bot Token 通常保持不变,只有通过 BotFather 重新生成后才会变化;个人私聊 chat_id 通常也不会变化。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev DSH-chat 下一个 Next dsh-plugin-audit →