# openalice-relay

> Telegram relay bot that polls the A2A Service and forwards agent messages to a Telegram chat.

## At a glance
| field | value |
|---|---|
| kind | `service` |
| priority | `—` |
| default branch | `mvp` |
| last activity | 2026-05-21T03:02:55+00:00 |
| features catalogued | **8** |
| runtime deps declared | **1** |

## Manifest
`.atlas-deps.yml` — parsed cleanly: **yes**

### Runtime deps
- **`openalice-a2a`** · `http` · via `A2A_URL` — Poll tasks/list (JSON-RPC) to fetch new A2A messages and forward them to Telegram

### Consumed env
- `A2A_URL`
- `A2A_API_KEY`
- `A2A_RELAY_BOT_TOKEN`
- `A2A_RELAY_CHAT_ID`
- `A2A_RELAY_CHANNEL`
- `RUST_LOG`

### Exposes
- `docker_image` — openalice-relay

## Env drift

**Manifest declares, code unused (1):**
- `RUST_LOG`

## Features (8)

### relay/a2a
- **`relay.a2a.mark_read`** · _alpha_ · since 0.1.0 — POST /api/v1/messages/{id}/read against A2A — currently unused, relay stays an observer so Alice's monitor owns read-state.  
  *src/main.rs:224*
- **`relay.a2a.poll`** · _beta_ · since 0.1.0 — JSON-RPC tasks/list call against the A2A Service, flattening submitted+completed task history into A2AMessage records with from/to/channel metadata.  
  *src/main.rs:106*

### relay/bot
- **`relay.bot.init`** · _beta_ · since 0.1.0 — Construct a RelayBot with a tuned reqwest client (30s timeout, 10s connect) and a now-anchored last_seen so restarts don't replay history.  
  *src/main.rs:54*

### relay/crate
- **`relay.crate`** · _beta_ · since 0.1.0 — Telegram relay bot binary — polls A2A Service and forwards agent messages to a Telegram chat for human visibility.  
  *src/main.rs:6*

### relay/telegram
- **`relay.a2a.telegram`** · _beta_ · since 0.1.0 — Poll A2A messages and forward each new one as an HTML-formatted Telegram message.  
  *src/main.rs:260*
- **`relay.telegram.auto_chat_id`** · _alpha_ · since 0.1.0 — Bootstrap path — when A2A_RELAY_CHAT_ID is unset, long-poll Telegram getUpdates until the first inbound message reveals a chat id.  
  *src/main.rs:355*
- **`relay.telegram.format`** · _beta_ · since 0.1.0 — Render an A2A message as HTML for Telegram — colour-coded emoji per sender, escaped from/to, timestamp, body.  
  *src/main.rs:237*
- **`relay.telegram.send`** · _beta_ · since 0.1.0 — POST a message to Telegram Bot API sendMessage with HTML parse mode and disabled link previews; logs body on non-2xx without failing the loop.  
  *src/main.rs:76*

---

*Generated by [openalice-atlas](https://atlas.blal.pro) — single source of truth for the openalicelabs ecosystem.*
