LosEcher/dsh-channel-telegram

LosEcher★ 0JavaScriptLast synced: 2026-08-15

Open on GitHub

DSH bundle: thin Telegram bridge (long-poll Bot API, allowlist, per-chat agent sessions) for DeepSeek Harness

README excerpt

dsh-channel-telegram Telegram 薄桥 插件:把 DSH 的 agent 通过 Telegram Bot 暴露出来——长轮询接收私聊消息,按 chatId 映射一个 DSH agent 会话(session id telegram- ),走与 ACP 桥完全相同的驱动模式( agents.create → agent.followup → agent.whenIdle ),回复最终 assistant 文本。 独立交付:不需要改动 DSH 仓库;DSH 的 Host loader 支持 绝对路径插件 entry ( mountRootInclude 对 isAbsolute 的 name 直接 file-URL 加载)。 文件 文件 说明 index.mjs Cordis 插件本体(named exports: name / inject / Config / apply ,规避 Loader 默认解包丢 Config 的问题) telegram-client.mjs 纯 Bot API 客户端(无 DSH 依赖,POST JSON body;4096 分块;401/409 错误映射) cordis.telegram.yml DSH overlay 模板( insert 进用户 patch 层) test/telegram-client.test.mjs mock Bot API 服务器单测( node test/telegram-client.test.mjs ) 启用步骤 1. Bot token :@BotFather 建 bot,拿 token。DSH 进程环境需有 TELEGRAM BOT TOKEN (改 tokenEnv 可换变量名)。 2. 拿到你的 chat id :给 @userinfobot 发条消息即可看到。 3. 配置 :把 cordis.telegram.yml 的 insert 合并进 $DSH HOME/cordis.patch.yml (全部 profile)或 $DSH HOME/profiles/ /cordis.patch.yml (单 profile), allowlist 填你的 chat id( 空 = 全部拒绝 )。 4. 重启 dsh web (新 host 插件在启动时加载),日志应出现 [dsh-channel-telegram] connected as @... 。 本地开发(未安装 bundle、直接引用源码)时把 name 换成 /absolute/path/to/dsh-channel-telegram/index.mjs (DSH Host loader 支持 绝对路径插件 entry)。 行为 - 允许名单 :非 allowlist 的私聊第一次收到"未授权"提示;…

View full README on GitHub →
Agentsdeepseek-harnessdsh-plugintelegram-botagent

Category