|
6 | 6 |
|
7 | 7 | `pi-telegram` turns a private Telegram DM into a mobile operator surface for Pi. It accepts prompts, queues work, streams readable previews, delivers final replies and files, exposes safe controls, and lets companion extensions add Telegram-native capabilities without owning a second bot loop. |
8 | 8 |
|
9 | | -It is a **runtime adapter**, not a remote terminal. Start or supervise work in the Pi TUI, then continue from Telegram while away from the keyboard. The bridge preserves Pi session semantics instead of pretending Telegram is a PTY, shell, or process launcher. That boundary is the product: Telegram gets safe runtime handles, not raw terminal power. |
| 9 | +It is a **runtime adapter**, not a remote terminal. Start or supervise work in the Pi TUI, then continue from Telegram while away from the keyboard. Each Telegram destination follows a running Pi instance and sends prompts into that instance's currently active session; it is not permanently bound to one session file or session identity. The bridge preserves Pi session semantics instead of pretending Telegram is a PTY, shell, process launcher, or session browser. That boundary is the product: Telegram gets safe runtime handles, not raw terminal power. |
10 | 10 |
|
11 | 11 | This repository is an actively maintained fork of [`badlogic/pi-telegram`](https://github.com/badlogic/pi-telegram). It started from upstream commit [`cb34008`](https://github.com/badlogic/pi-telegram/commit/cb34008460b6c1ca036d92322f69d87f626be0fc) and has since diverged substantially. |
12 | 12 |
|
@@ -45,7 +45,7 @@ Run this inside Pi: |
45 | 45 |
|
46 | 46 | Paste the bot token. If `~/.pi/agent/telegram.json` already contains a saved token, setup offers it as the default. If no saved token exists, setup can prefill from `TELEGRAM_BOT_TOKEN`, `TELEGRAM_BOT_KEY`, `TELEGRAM_TOKEN`, or `TELEGRAM_KEY`. Named profiles are optional; the ordinary `/telegram-setup` and `/telegram-connect` flow keeps using the default profile. Use `/telegram-setup <name>` only when you want an additional bot profile. Cancelling or failing named-profile token validation leaves the currently active profile and polling runtime unchanged; setup reports the profile as saved and connected only after polling startup succeeds. |
47 | 47 |
|
48 | | -### 3. Connect this Pi session |
| 48 | +### 3. Connect this Pi instance and its active session |
49 | 49 |
|
50 | 50 | ```bash |
51 | 51 | /telegram-connect |
@@ -77,8 +77,8 @@ The first Telegram user to message the bot becomes the allowed owner. Other user |
77 | 77 |
|
78 | 78 | | Lens | What `pi-telegram` owns | |
79 | 79 | | --- | --- | |
80 | | -| Operator companion | A phone-width control surface for a live Pi session | |
81 | | -| Runtime adapter | Telegram turns mapped into Pi lifecycle, queueing, previews, final replies, and artifacts | |
| 80 | +| Operator companion | A phone-width control surface for the active session of a running Pi instance | |
| 81 | +| Runtime adapter | Telegram targets mapped to Pi instances, then into each instance's current session lifecycle, queueing, previews, final replies, and artifacts | |
82 | 82 | | Telegram UI harness | Menus, settings, callbacks, Rich Markdown, drafts, active status, buttons, voice, and files | |
83 | 83 | | Multi-instance organism | One leader plus explicit visible followers routed through Telegram private-chat threads | |
84 | 84 | | Extension platform | Commands, sections, status rows, update handlers, inbound/outbound handlers, and voice providers | |
@@ -194,8 +194,8 @@ Classic private DM mode is the base product mode. When Telegram private-chat Thr |
194 | 194 |
|
195 | 195 | | Mode | Best for | Runtime shape | |
196 | 196 | | --- | --- | --- | |
197 | | -| Classic DM | One live Pi session controlled from one private bot chat | One polling owner, one queue/runtime surface | |
198 | | -| Threaded Mode | Several visible Pi terminals sharing one bot | One leader owns transport; followers route through named private-chat threads | |
| 197 | +| Classic DM | One running Pi instance and its active session controlled from one private bot chat | One polling owner, one queue/runtime surface | |
| 198 | +| Threaded Mode | Several visible Pi instances sharing one bot | One leader owns transport; each named private-chat thread follows its assigned instance and current session | |
199 | 199 |
|
200 | 200 | ## Environment Configuration |
201 | 201 |
|
@@ -239,7 +239,9 @@ Stable public entrypoints are documented in [Public API](./docs/public-api.md), |
239 | 239 | - Replace Pi session lifecycle without an official Pi API. |
240 | 240 | - Let non-owner Telegram users control the bridge. |
241 | 241 |
|
242 | | -Telegram is a companion surface around a live Pi runtime, not a second runtime. |
| 242 | +Telegram is a companion surface around a live Pi runtime, not a second runtime. It can compact the current session, but it cannot create, resume, fork, browse, or switch sessions until Pi exposes safe public extension APIs for those operations. |
| 243 | + |
| 244 | +A Telegram prompt is a normal model turn in the active Pi session and therefore inherits that session's active post-compaction context; the bridge does not make token cost proportional only to the new mobile message. Current releases keep per-turn guidance small and transient, with detailed bridge instructions available on demand through `telegram_help` instead of persisted in every user turn. Pi session JSONL contains model history; profile-scoped pi-telegram `logs*.jsonl` contains redacted operational events and is never model context. |
243 | 245 |
|
244 | 246 | ## Documentation Map |
245 | 247 |
|
|
0 commit comments