You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,11 @@
4
4
5
5
No open changes.
6
6
7
+
## 0.15.0: Companion Status Lines
8
+
9
+
-`[API]` Added `registerTelegramStatusLineProvider()` on the public `/status` subpath so companion extensions can append compact rows to the `/start` menu status text. Providers are synchronous, model-aware, isolated on failure, and rendered with Telegram-style capitalized labels. Impact: quota/status widgets can progressively enhance the Telegram operator menu without owning polling, transport, or core menu rendering.
10
+
-`[Docs]` Documented the status-line provider with an abstract companion-extension example and listed `pi-codex-usage` as a companion extension. Impact: the public API docs stay implementation-neutral while the README still points operators to the concrete Codex quota widget.
11
+
7
12
## 0.14.0: Direct Telegram Delivery, Queue Semantics, And Section Diagnostics
8
13
9
14
-`[Prompt Guidance]` Tightened agent context for Telegram buttons: use normal Markdown plus top-level hidden `telegram_button` comments, never JSON button specs or standalone button actions, and keep comments out of code/quotes/lists/indented examples. Impact: agents immediately know how to author visible Telegram text, inline buttons, and direct `telegram_message` payloads without transport hacks.
Copy file name to clipboardExpand all lines: README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -209,7 +209,7 @@ Unknown inline-button callbacks are forwarded to π as `[callback] <data>` when
209
209
210
210
### Extension Sections
211
211
212
-
Ordinary pi extensions can register structured UI sections that appear in the main Telegram menu and Settings submenu without owning a second polling loop. Each section gets a narrow typed context with `edit`, `open`, `enqueuePrompt`, `answerCallback`, and `callbackData()` — enough to build interactive Telegram-native surfaces while `pi-telegram` owns transport, callback routing, navigation hierarchy, and diagnostics.
212
+
Ordinary pi extensions can register structured UI sections that appear in the main Telegram menu and Settings submenu without owning a second polling loop. Companion extensions can also register compact status lines for the `/start` menu status text, allowing widgets such as quota indicators to appear beside Status, Usage, Cost, and Context only when relevant to the active model. Each section gets a narrow typed context with `edit`, `open`, `enqueuePrompt`, `answerCallback`, and `callbackData()` — enough to build interactive Telegram-native surfaces while `pi-telegram` owns transport, callback routing, navigation hierarchy, and diagnostics.
213
213
214
214
Import `registerTelegramSection()` from `@llblab/pi-telegram/sections` and return a disposer on shutdown. Sections can send interactive messages directly into the chat via `ctx.open()` — confirmation dialogs, approve/deny gates, and multi-step forms live outside the menu hierarchy while callbacks route through the same typed handler. See [`@llblab/pi-telegram-extension-demo`](https://github.com/llblab/pi-telegram-extension-demo) for a working reference and the [Extension Sections Standard](./docs/sections.md) for the full contract.
215
215
@@ -260,6 +260,12 @@ Modes are `hidden`, `always`, and `interval`. `hidden` means no time line is add
260
260
261
261
Third-party extensions that integrate with `pi-telegram`:
262
262
263
+
-[`pi-codex-usage`](https://github.com/llblab/pi-codex-usage) — Compact Codex subscription quota/status widget for the Pi statusline and the inline menu status text opened by `/start`.
264
+
265
+
```bash
266
+
pi install npm:@llblab/pi-codex-usage
267
+
```
268
+
263
269
-[`pi-telegram-tool-status`](https://github.com/Timur00Kh/pi-telegram-tool-status) — Live-updating service messages that list tools used by the agent. It keeps one message per Telegram prompt and edits it in place as tools execute.
- Purpose: compact companion status rows in the `/start` menu status text.
105
109
-`registerTelegramVoiceTranscriptionProvider()`
106
110
- Identity: required stable `id` for new code.
107
111
- Purpose: STT fallback for voice/audio input.
@@ -165,6 +169,27 @@ Contract:
165
169
166
170
Full behavior: [Extension Sections](./sections.md).
167
171
172
+
## Status Lines
173
+
174
+
Import from `@llblab/pi-telegram/status`.
175
+
176
+
```ts
177
+
const off =registerTelegramStatusLineProvider(
178
+
({ activeModel }) => {
179
+
if (activeModel?.provider!=="example-provider") returnundefined;
180
+
return { label: "service", value: "ready" };
181
+
},
182
+
{ id: "@scope/example-status" },
183
+
);
184
+
```
185
+
186
+
Contract:
187
+
188
+
- Providers are synchronous because `/start` status text is rendered inline with the menu.
189
+
- Return `undefined` when the line is not relevant for the active model.
190
+
- Provider failures are isolated and skipped so optional companion status cannot break the core Telegram menu.
191
+
- The bridge renders rows as `<Label>: <value>` in the same HTML status block as Status, Usage, Cost, and Context, capitalizing the first label character for Telegram UI consistency.
0 commit comments