Commit Graph

38 Commits

Author SHA1 Message Date
wassname 29ac175e79 refactor: per-block Telegram emission, displayMode replaces traceVisible
- Each pi output block (thinking, tool_call, tool_result) emits a
  separate Telegram message as it arrives; text content still streams
  in a single edit-in-place preview message
- Replace traceVisible bool with displayMode: "full" | "compact" | "text"
  (/trace cycles through all three; compact is default)
- Add renderBlockMessage() to lib/rendering.ts; delete old transcript
  aggregation helpers (buildTelegramAssistantTranscriptMarkdown, etc.)
- registerTelegramBotCommands now pulls extension commands from
  pi.getCommands() in addition to local bot commands
- Update rendering tests for new block rendering API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 15:29:05 +08:00
wassname 15fa661b7a security: require pre-configured allowedUserId, remove auto-pair
The first-DM auto-pair behavior combined with ! shell passthrough meant
the first account to DM the bot gained arbitrary shell access. This
removes that footgun entirely.

- allowedUserId must be set before polling starts; missing config blocks
  polling with a TUI warning rather than silently accepting any sender
- TELEGRAM_ALLOWED_USER_ID env var is read on session start and
  overwrites the saved config value, so rotating the allowed user is a
  restart away
- /telegram-setup now prompts for a numeric user ID after the bot token
  if one is not already configured
- Denied senders receive an auth error reply; their numeric ID is also
  logged to the pi TUI as a warning so operators can identify themselves
  on a fresh install without needing @userinfobot
- Dropped the {kind: "pair"} authorization state entirely; undefined
  allowedUserId now produces deny, not pair
- Removed pairTelegramUserIfNeeded, shouldPair, shouldNotifyPaired

Existing installs with allowedUserId already in telegram.json are
unaffected. Fresh installs require explicit configuration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 06:04:56 +08:00
wassname c28436503f slash 2026-04-21 18:09:09 +08:00
wassname 5da34c33a2 skip [telegram] prefix for ! commands so pi handles them natively as shell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 21:38:51 +08:00
wassname 96b4d6fa67 Merge branch 'main' of https://github.com/wassname/pi-telegram 2026-04-19 18:21:50 +08:00
wassname 079a7a8dbb misc 2026-04-19 18:21:44 +08:00
wassname 5e10ff9f64 show tools 2026-04-19 16:20:11 +08:00
wassname c2d25b31fe wip 2026-04-19 16:08:23 +08:00
wassname 5aa37b7a99 tool verbose 2026-04-19 15:41:15 +08:00
LLB e7e3e86550 0.2.7: priority symbol 2026-04-17 14:33:55 +04:00
LLB 85816ac5f6 0.2.6: readme fix 2026-04-16 00:43:33 +04:00
LLB f6194693e5 0.2.5: model menu updates fix 2026-04-11 12:45:49 +04:00
LLB 31a538db64 0.2.4: description fix 2026-04-11 11:57:00 +04:00
LLB 137728773f 0.2.3: remove package-lock.json 2026-04-11 11:54:17 +04:00
LLB 0997112b7c 0.2.2: readme fix 2026-04-11 11:52:19 +04:00
LLB 0211fd6e10 readme fix 2026-04-11 11:51:09 +04:00
LLB 426d8bf317 prepare npm package publish 2026-04-11 11:38:19 +04:00
LLB 8dcf761937 0.2.0: refactor into domain modules 2026-04-11 11:32:44 +04:00
LLB 233b20b089 bot token from env 2026-04-11 02:21:28 +04:00
LLB a2bb588c3b agents & in-flight model switching 2026-04-11 01:56:28 +04:00
LLB e6d6eba2de readme & screenshot update 2026-04-11 01:04:57 +04:00
LLB e2bb0799c7 markdown & queue hardening 2026-04-10 14:49:20 +04:00
LLB 1e35559e22 "message is not modified" fix 2026-04-10 10:47:08 +04:00
LLB b0c630a973 markdown fix 2026-04-10 02:01:20 +04:00
LLB 105cbb49f1 queue upgrade 2026-04-10 01:49:22 +04:00
LLB 506ef83a69 refactoring 2026-04-09 11:44:02 +04:00
LLB 8d227c53e9 simplify model select 2026-04-09 10:39:02 +04:00
LLB 038000605a markdown support 2026-04-09 09:52:36 +04:00
LLB ce6ef93220 register commands 2026-04-09 09:07:03 +04:00
LLB da81d26c60 model switch 2026-04-09 08:50:21 +04:00
LLB 2360037777 preparation 2026-04-09 08:49:45 +04:00
Mario Zechner cb34008460 docs: trim screenshot 2026-04-04 04:13:07 +02:00
Mario Zechner 4919f4400b docs: update session transcript link 2026-04-04 04:11:26 +02:00
Mario Zechner c1a9a12d73 Add screenshot to README 2026-04-04 03:59:11 +02:00
Mario Zechner f0506540c6 Add build session link to README 2026-04-04 03:57:41 +02:00
Mario Zechner aed722c52b fix: handle telegram compact command 2026-04-04 03:50:13 +02:00
Mario Zechner caf3617747 feat: add telegram compact and status commands 2026-04-04 03:48:07 +02:00
Mario Zechner 27bd379159 feat: add pi telegram extension package 2026-04-04 03:42:02 +02:00