BrowserUse_and_ComputerUse_.../gateway/platforms
Teknium 4920c5940f
feat: auto-detect local file paths in gateway responses for native media delivery (#1640)
Small models (7B-14B) can't reliably use MEDIA: or IMAGE: syntax. This
adds extract_local_files() to BasePlatformAdapter that regex-detects
bare local file paths ending in image/video extensions, validates them
with os.path.isfile(), and delivers them as native platform attachments.

Hardened over the original PR:
- Code-block exclusion: paths inside fenced blocks and inline code are
  skipped so code samples are never mutilated
- URL rejection: negative lookbehind prevents matching path segments
  inside HTTP URLs
- Relative path rejection: ./foo.png no longer matches
- Tilde path cleanup: raw ~/... form is removed from response text
- Deduplication by expanded path
- Added .webm to _VIDEO_EXTS
- Fallback to send_document for unrecognized media extensions

Based on PR #1636 by sudoingX.

Co-authored-by: sudoingX <sudoingX@users.noreply.github.com>
2026-03-17 01:47:34 -07:00
..
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
ADDING_A_PLATFORM.md docs: finish cron terminology cleanup 2026-03-14 19:20:58 -07:00
base.py feat: auto-detect local file paths in gateway responses for native media delivery (#1640) 2026-03-17 01:47:34 -07:00
discord.py feat(discord): auto-thread on @mention + skip mention in bot threads 2026-03-15 07:59:55 -07:00
email.py feat(email): add skip_attachments option via config.yaml 2026-03-16 05:27:54 -07:00
homeassistant.py fix: Home Assistant event filtering now closed by default (#1169) 2026-03-13 07:40:38 -07:00
signal.py fix(signal): align send() signature with base class (content, reply_to, metadata) 2026-03-10 15:18:26 -07:00
slack.py refactor: centralize slash command registry (#1603) 2026-03-16 23:21:03 -07:00
telegram.py refactor: centralize slash command registry (#1603) 2026-03-16 23:21:03 -07:00
whatsapp.py fix(cli): respect HERMES_HOME in all remaining hardcoded ~/.hermes paths 2026-03-13 21:32:53 -07:00