zot/internal/agent
patriceckhart cead9fdff1 telegram: let zot send images and files back through the bridge
The bridge already mirrored the assistant's text reply into the
paired Telegram chat but had no way to push real attachments. A
turn that came in over Telegram could only ever produce a textual
description of an image, never the image itself.

Add two model-facing tools, registered on the running agent only
while the bridge is connected:

- telegram_send_image(path, caption?) uploads a local image
  (png/jpg/gif/webp) as an inline Telegram photo. Telegram
  compresses for preview, which is what you usually want for a
  screenshot or chart.

- telegram_send_file(path, caption?) uploads any local file as a
  document attachment with no compression. Use for non-images or
  when the recipient needs the original bytes.

Plumbing:

- Client.SendPhoto multipart upload mirrors SendDocument, hitting
  sendPhoto so Telegram renders the image inline.
- Bridge.SendImage / SendDocument resolve the paired chat id and
  return a clear error when the bridge is not running or no user
  has paired yet.
- A small TelegramSender interface in package tools keeps the
  tools package free of any telegram dependency; an adapter in
  interactive.go forwards to the live *telegram.Bridge.
- applyTelegramTools mutates the running agent's tool registry on
  /telegram connect / disconnect, on /model swaps, and on login
  rebuilds. Walks the live registry rather than restoring from a
  snapshot so extension or /reload-ext additions survive a later
  disconnect; we only add or strip the two telegram entries.

Both tools respect the sandbox, refuse non-image inputs in
send_image, and reject directories. They return a one-line text
result the model can use to confirm the upload ("sent /path/foo.png
to telegram (1.2 MB)").
2026-04-28 08:23:04 +02:00
..
extensions feat(ext): interactive extension panels + persistence 2026-04-22 08:53:21 +02:00
modes telegram: let zot send images and files back through the bridge 2026-04-28 08:23:04 +02:00
tools telegram: let zot send images and files back through the bridge 2026-04-28 08:23:04 +02:00
args.go tui: unify accent bar, narrow status split, restore session usage 2026-04-27 19:51:36 +02:00
botcmd.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_unix.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
botcmd_windows.go fix ci on windows: split detach helper into posix/windows variants 2026-04-18 10:58:10 +02:00
build.go feat: remove default step limit 2026-04-26 13:32:46 +02:00
changelog.go fix(changelog): strip commit/date suffix from version strings 2026-04-25 17:50:35 +02:00
cli.go session: persist each turn as it happens, flush on SIGTERM/SIGHUP 2026-04-28 08:01:12 +02:00
config.go feat: auto-refresh OAuth tokens before each API call 2026-04-24 19:37:44 +02:00
extcmd.go feat: extension system (subprocess + json-rpc, any language) 2026-04-19 14:09:43 +02:00
modelsync.go feat(models): support user-defined models via models.json 2026-04-23 23:09:32 +02:00
rpc.go feat(ext): interactive extension panels + persistence 2026-04-22 08:53:21 +02:00
systemprompt.go feat(tui): context diffs + framed tool blocks + paced streaming 2026-04-20 15:50:39 +02:00
update.go fix(update): re-check every launch when the cache says up-to-date 2026-04-20 18:31:51 +02:00