wsz987/dsh-channels--packages-channel-telegram ↗★ 2
@wsz987/channel-telegram
用于 DeepSeek Harness 的 Telegram 机器人 API 渠道适配器(M5 可扩展性概念验证)
AI 分析
核心用途是作为第三方渠道适配器的开发范例,将 Telegram 机器人接入 DSH。适合需要研究 DSH 公共渠道协议或在海外部署 Telegram 智能体的开发者。
安裝
此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗
說明文件
閱讀完整 README ↗@wsz987/channel-telegram
Telegram Bot API channel adapter for DeepSeek Harness — the M5 extensibility proof.
Install
pnpm add @wsz987/channel-telegram
Extensibility proof
This package was built against the public Channel Contract (@wsz987/channel-core +
@wsz987/channel-testkit) with zero changes to channel-core, channel-harness,
the @wsz987/dsh-channels bundle, or the four official adapters (weixin / qq / dingtalk /
lark). It is a fifth channel that joins the ecosystem exactly the way a third-party
adapter would.
Deliberately NOT part of the
@wsz987/dsh-channelsbundle. The bundle ships the four official channels; this adapter is the standalone proof that the contract is extensible from the outside, without any core or harness changes.
What the proof exercises:
ChannelAdaptercontract (start/stop/send/getHealth/ capabilities)runChannelAdapterContract— the testkit's full contract suite passes- Cordis plugin shape (
name/inject/applyviactx.effect) - Schemastery
Configwith an injectableHttpTransport(offline fake in tests) - Fixture-driven mapper tests (
fixtures/telegram/*.json, Bot API 7.10 shapes) - M4 governance:
readonly manifestclass field +manifest.tsforchannels doctorcompatibility checks
Pointing it at a real bot
In your profile config:
{
"plugins": {
"channel-telegram": {
"enabled": true,
"accountId": "main",
"baseUrl": "https://api.telegram.org",
"token": "",
"longPollTimeoutMs": 25000
}
}
}
The token is a secret: it is never logged (bearer-style path segments are redacted in transport error messages) and it only ever appears in the Bot API request path built by the upstream driver. It is never written into fixture files.
Capabilities
| capability | value |
|---|---|
| text / image / file / audio / video | ✅ |
| markdown | ✅ |
| reactions | ✅ |
| cards | ❌ |
| threads | ❌ |
| streaming | buffered — Telegram editMessageText makes edit streaming reachable; documented future capability |
Known limits (V1 proof)
streaming: 'buffered'— chunks accumulate and are delivered once per turn.- Media outbound sends a public
urlor a platformfile_id(resourceRef) as the Bot API file reference (sendPhoto/…photo:); real file uploads (multipart/form-data) andgetFile-based downloads are future work. - Inbound media maps Telegram
file_idto the contract'sresourceRefcarrier (an opaque platform handle), never tourl—urlis reserved for realhttp(s)URLs. beginAuth/pollAuthare omitted: auth is token-driven (getMe() check at start).chat.type === 'channel'currently maps to admconversation.
Development
pnpm --filter @wsz987/channel-telegram build
pnpm --filter @wsz987/channel-telegram typecheck
pnpm --filter @wsz987/channel-telegram test