Files
stack/plugins/telegram
Jason Woltje 13934d4879
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
feat: npm publish pipeline + package versioning (0.0.1-alpha.1)
Publish pipeline:
- Add publish-npm step to .woodpecker/publish.yml — publishes all
  @mosaic/* packages to Gitea npm registry on main push/tag
- Requires gitea_npm_token Woodpecker secret (package:write scope)
- publish-npm runs after build, parallel with Docker image builds
- pnpm publish resolves workspace:* to concrete versions automatically

Package configuration:
- All 20 packages versioned at 0.0.1-alpha.1
- publishConfig added to all packages (Gitea registry, public access)
- files field added to all packages (ship only dist/)
- @mosaic/forge includes pipeline/ assets in published package

Meta package (@mosaic/mosaic):
- Now depends on @mosaic/forge, @mosaic/macp, @mosaic/prdy,
  @mosaic/quality-rails, @mosaic/types
- npm install @mosaic/mosaic pulls in the standalone framework

Build fixes:
- Fix forge and macp tsconfig rootDir: '.' -> 'src' so dist/index.js
  resolves correctly (was dist/src/index.js)
- Exclude __tests__ and vitest.config from build includes
- Clean stale build artifacts from old rootDir config

Required Woodpecker secret:
  woodpecker secret add mosaic/mosaic-stack \
    --name gitea_npm_token --value '<token>' \
    --event push,manual,tag
2026-04-01 12:46:13 -05:00
..

@mosaic/telegram-plugin

@mosaic/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