@agfpd/telegram-runtime

中文文档
0.28.14发布于 2026/11/06Apache-2.0ES Module构建来源已验证近 30 天下载 2000

Telegram runtime-router for IAP peers.

原始使用文档
文档目录5 节
  1. How it works
  2. Quick start
  3. What makes it different
  4. Documentation
  5. License

telegram-runtime

A Telegram bridge for a team of AI agents — the human-presence component of iapeer.

CI npm license platform

telegram-runtime gives a person presence in an iapeer agent team through Telegram: the owner messages an agent from the messenger and gets replies in the same chat. To the agent, the person is an ordinary peer it messages with send_to_peer — the bridge turns that into a Telegram message in the right chat, and turns the person's reply back into an ordinary inbound message. It carries voice, attachments, a typing indicator, an activity stream, and control commands.

Built for iapeer. It isn't a standalone bot framework — it runs only inside iapeer, alongside iapeer-memory and notifier-runtime. It's an iapeer runtime, the human counterpart to the Claude, Codex and OpenCode agent runtimes, that iapeer provisions and launches and whose messages travel over iapeer's own routing.

How it works

   person in Telegram                          agent (Claude/Codex/OpenCode)
        │  messages the bot                         │  send_to_peer(arthur, "…")
        ▼                                            ▼
   ┌──────────────────────────────────────────────────────────┐
   │  telegram-runtime — the bridge                             │
   │  inbound:  Telegram → recipient peer (voice → text)        │
   │  outbound: peer → Telegram chat (text, files, voice)       │
   │  typing indicator · activity stream · chat commands        │
   └──────────────────────────────────────────────────────────┘

Quick start

You need a working iapeer install and a Telegram bot token from @BotFather.

npx @agfpd/telegram-runtime                       # install: binary + manifest
iapeer connect telegram <agent> --token <token>   # bind a bot to the agent
# then send the bot its first message from Telegram (a bot can't start a chat)

Check the chain:

telegram-runtime doctor

Run doctor from the human peer's working directory, not this source tree. It checks configuration, not inbound liveness. For read-only polling evidence:

telegram-runtime polling --log ~/.iapeer/logs/arthur/telegram-arthur.log --json

Use your human peer's runtime log path. This does not contact Telegram or restart the bridge.

What makes it different

  • Transparent channel. Agents get no Telegram tools — to an agent, the person is just a named peer. The same send_to_peer reaches a human and an AI alike.
  • Bindings from passports, no separate database. A person carries their Telegram id, an agent carries its bot binding — both in their peer profiles. The bridge reads them and builds the route.
  • Voice both ways. Voice in is transcribed to text (with a local fallback); voice out is delivered as a Telegram voice message.
  • Live presence. A typing indicator while the agent works, and an optional activity stream showing which tools it's using right now.
  • Control from the chat. /stop, /new, /compact, and operator-defined alias shortcuts — intercepted and run through iapeer, never delivered to the agent as text.
  • Multiple bots, one process. Each agent has its own bot; the bridge polls them all in a single process, one lock per bot.

Documentation

docs/ — what it is and how to use it (English; Russian in docs/ru/). This repository is the implementation.

License

Apache-2.0. Platform: macOS. telegram-runtime is the human-presence runtime for the iapeer ecosystem — a component of iapeer, not a standalone system.

版本与发布记录

@agfpd/telegram-runtime 共发布 46 个版本,首次发布于 2026/06/08;过去 12 个月发布了 46 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.28.14latest2026/11/061 天前
0.28.132026/11/062 天前
0.28.122026/11/043 天前
0.28.112026/11/043 天前
0.28.102026/11/016 天前
0.28.92026/10/308 天前

关于 @agfpd/telegram-runtime 的常见问题

@agfpd/telegram-runtime 是什么?

Telegram runtime-router for IAP peers.

如何安装 @agfpd/telegram-runtime?

在项目目录运行 npm install @agfpd/telegram-runtime,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 telegram-runtime,可以用 npx telegram-runtime 直接运行。

@agfpd/telegram-runtime 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/agfpd__telegram-runtime 是否存在。

@agfpd/telegram-runtime 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agfpd/telegram-runtime 可以商用吗?

@agfpd/telegram-runtime 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agfpd/telegram-runtime 的下载量有多少?

根据 npm 官方下载统计,@agfpd/telegram-runtime 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,000 次,日均约 67 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agfpd/telegram-runtime 还在维护吗?

最新版本 0.28.14 发布于 2026/11/06(1 天前);至今共发布 46 个版本,其中过去 12 个月发布了 46 个;首次发布于 2026/06/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。