← Back to home@zhang0098

dsh-telegram-channel

Telegram mobile remote for DeepSeek Harness sessions (Martty/ACP-compatible fork of hi-wenw/dsh-telegram-channel): bind a chat to a live session, plain text = followup, /model /last /sessions.

Stars
0
Language
TypeScript
Created
Sep 23, 2026
Updated
Oct 3, 2026
GitHub repo

Introduction

dsh-telegram-channel(martty 兼容 fork)

项目由来:本仓库 fork 自 hi-wenw/dsh-telegram-channel(MIT,版权归上游 contributors,见 LICENSE)。

fork 原因:原版在 Martty Host(dsh --profile martty)上无法启动——它硬声明 inject: ['agents', 'apiProxy'],而 apiProxy 只有 web profile(dsh-host-apiproxy)提供;Cordis 的 inject 全为必选,fiber 永久 pending,启动报 1 entry did not activate(openma-ai/Martty#46)。

差异:不再 inject apiProxy(改运行时探测);/model 无 apiProxy 时回退到 ctx.llm + installModelSelection 本地路径。web profile 行为与上游一致。上游修复后本 fork 可同步或退役。

dsh 版本对齐:peerDependencies 声明 @deepseek-ai/dsh-*: ^0.2.0-rc.2,与 dsh 0.2.x(含 0.2.0-rc.2/后续 0.2 补丁)兼容。dsh 启动时会用该声明做版本闸门(peer 不匹配的 bundle 会被跳过并打印 skipping profile bundle),所以升级 dsh 到 0.3 之前需要先更新这里。

Telegram 手机遥控器 for DeepSeek Harness:附着本机会话,手机 ↔ 电脑同轨迹、双向可见。

环境要求

组件版本
dsh0.2.x(本仓库按 0.2.0-rc.2 构建与验证)
Node≥ 22

安装

# web profile(列运行中的本机会话,/model 走本地)
dsh plugin --profile web add github:zhang0098/dsh-telegram-channel

# martty profile(同上)
dsh plugin --profile martty add github:zhang0098/dsh-telegram-channel

dsh 0.2 起没有 apiProxy:web 宿主的 RPC 面改成 typert 远程服务,apiProxy(dsh-host-apiproxy)已不再提供。插件改为直接读取宿主服务,探测不到 apiProxy 时走本地路径:

能力dsh 0.1(apiProxy)dsh 0.2(本仓库)
会话目录apiProxy.workspace.list + sessions.listctx.sessionQuery.listSessions()(含冷会话)+ ctx.workspaceRegistry(web 层,提供标题/顺序/归档集)
/lastapiProxy.sessions.historyctx.sessionQuery.readSession()
/modelapiProxy.sessions.models/selectModelctx.llm + installModelSelection
附着冷会话agents.resumeagents.resume(不变)

两代路径都保留:有 apiProxy 的宿主仍走 apiProxy,没有的走上面这套。

环境变量(或 config):DSH_TELEGRAM_TOKEN、DSH_TELEGRAM_ALLOWED_USER_IDS(数字白名单,可逗号分隔)。

使用

  • /sessions → 选工作区 → 选会话 → 附着;之后手机发文字即进入该会话(与电脑同轨迹)
  • 会话列表来自宿主会话索引:冷会话也会列出,附着时自动 resume(不关闭电脑上的会话);归档、空白、subagent 会话按 Web 规则排除。宿主既没有 apiProxy 也没有 sessionQuery 时才降级为“只列运行中的会话”
  • 附着冷会话后沿用该会话上次使用的模型(dsh 0.2 的 resume 不带 AgentOptions,不这么做第一条消息会因 {{model}} 无值而失败);之后可用 /model 切换
  • 宿主询问(ask_user_question / plan review)双渠道镜像:绑定后问题同时出现在 Telegram 与电脑 TUI/Web,任一渠道回答即生效(先答者胜)
  • /last 查看上次问答(含未附着的冷会话);/model 切换模型(下一回合生效);/status 查看绑定;/unbind 断开(不关电脑会话);/help 帮助
  • 一键管理脚本:scripts/install.ps1(Windows)/ scripts/install.sh(Unix),-ProfileName martty 指定 profile

配置

键 / 环境变量含义
token / DSH_TELEGRAM_TOKENBot token
allowedUserIds / DSH_TELEGRAM_ALLOWED_USER_IDS白名单;都空 = 谁都不能用
allowAllUserstrue 仅调试
maxMessageLength默认 4096
pollingTimeoutSec默认 30
renderingrich(默认)或 html

开发

pnpm install
pnpm test
pnpm run build

License

MIT(上游 hi-wenw 及 fork 贡献者)


English (summary)

Fork of hi-wenw/dsh-telegram-channel (MIT) to run on the Martty / ACP host (dsh --profile martty): the upstream hard-injects apiProxy, a web-profile-only service, which parks the Cordis fiber forever (1 entry did not activate, see openma-ai/Martty#46). This fork probes apiProxy at runtime, adds a local /model fallback over ctx.llm, and keeps web-profile behavior identical.

Aligned with dsh 0.2.x (@deepseek-ai/dsh-* peers ^0.2.0-rc.2). dsh 0.2 gates every plugin bundle on those peer ranges, so an older declaration makes the launcher skip the bundle (skipping profile bundle dsh-telegram-channel). dsh 0.2 also dropped apiProxy (the Web host's RPC surface is now typert remotes), so the plugin reads the harness services directly: the session catalog comes from ctx.sessionQuery (+ ctx.workspaceRegistry for titles/order/archives on web), /last from sessionQuery.readSession(), and /model from ctx.llm + installModelSelection. Cold sessions are listed and resumed on attach; the legacy apiProxy path is still used on 0.1 hosts.

dsh plugin --profile web add github:zhang0098/dsh-telegram-channel
dsh plugin --profile martty add github:zhang0098/dsh-telegram-channel

Bot commands: /sessions (workspace → session → bind), plain text = followup, /last, /model, /status, /unbind, /help. Env: DSH_TELEGRAM_TOKEN, DSH_TELEGRAM_ALLOWED_USER_IDS.