@mosaicstack/telegram-plugin (0.0.3-next.2677)

Published 2026-08-25 16:35:43 +00:00 by woodpecker in mosaicstack/stack

Installation

@mosaicstack:registry=https://git.mosaicstack.dev/api/packages/mosaicstack/npm/
npm install @mosaicstack/[email protected]
"@mosaicstack/telegram-plugin": "0.0.3-next.2677"

About this package

`@mosaicstack/telegram-plugin` connects a Telegram bot to the Mosaic gateway chat namespace so Telegram chats can participate in the same conversation flow as the web, TUI, and Discord channels.

@mosaicstack/telegram-plugin

@mosaicstack/telegram-plugin connects a Telegram bot to the Mosaic gateway chat namespace so Telegram chats can participate in the same conversation flow as the web, TUI, and Discord channels.

Required Environment Variables

  • TELEGRAM_BOT_TOKEN: Bot token issued by BotFather
  • TELEGRAM_GATEWAY_URL: Base URL for the Mosaic gateway, for example http://localhost:3000

What It Does

  • Launches a Telegram bot with telegraf
  • Connects to ${TELEGRAM_GATEWAY_URL}/chat with socket.io-client
  • Maps Telegram chat.id values to Mosaic conversationId values
  • Forwards inbound Telegram text messages to the gateway as user messages
  • Buffers agent:start / agent:text / agent:end socket events and sends the completed response back to the Telegram chat

Getting a Bot Token

  1. Open Telegram and start a chat with @BotFather
  2. Run /newbot
  3. Follow the prompts to name the bot and choose a username
  4. Copy the generated token and assign it to TELEGRAM_BOT_TOKEN

Dependencies

Dependencies

ID Version
socket.io-client ^4.8.0
telegraf ^4.16.3

Development Dependencies

ID Version
typescript ^5.8.0
vitest ^2.0.0
Details
npm
2026-08-25 16:35:43 +00:00
0
4.8 KiB
Assets (1)
Versions (79) View all
0.0.3-next.2799 2026-08-26
0.0.3-next.2680 2026-08-25
0.0.3-next.2677 2026-08-25
0.0.3-next.2671 2026-08-25
0.0.3-next.2669 2026-08-25