Skip to content

feat: add iMessage platform support via BlueBubbles Server#4588

Closed
1960697431 wants to merge 1 commit into
NousResearch:mainfrom
1960697431:feat/imessage-bluebubbles
Closed

feat: add iMessage platform support via BlueBubbles Server#4588
1960697431 wants to merge 1 commit into
NousResearch:mainfrom
1960697431:feat/imessage-bluebubbles

Conversation

@1960697431

Copy link
Copy Markdown

Summary

This PR adds a complete iMessage platform adapter for Hermes, enabling communication through Apple's iMessage via BlueBubbles Server.

Features

  • Full text messaging — send and receive iMessages (DMs and group chats)
  • Rich media support — images, voice messages, videos, and file attachments
  • Tapback reactions — love, like, dislike, laugh, emphasize, question (via BlueBubbles Private API)
  • Read receipts — mark messages as read automatically
  • Polling-based message retrieval with GUID deduplication to prevent duplicate processing
  • Interactive CLI setuphermes setup walks through BlueBubbles configuration

Prerequisites

Requires BlueBubbles Server running on a Mac with Apple Messages configured. The following environment variables are used:

Variable Required Description
BLUEBUBBLES_SERVER_URL Yes BlueBubbles server URL (e.g. http://localhost:1234)
BLUEBUBBLES_PASSWORD Yes BlueBubbles server password
IMESSAGE_HOME_CHANNEL No Default chat GUID for home channel

Files Changed

  • gateway/platforms/imessage.py — New iMessage adapter (~730 lines), implementing BasePlatformAdapter
  • gateway/config.py — Added IMESSAGE to Platform enum and env var loading
  • gateway/run.py — Added adapter factory case for iMessage
  • hermes_cli/gateway.py — Added interactive setup flow, with null token_var handling
  • agent/prompt_builder.py — Added platform hints for iMessage
  • toolsets.py — Added hermes-imessage toolset
  • cron/scheduler.py — Added to platform map
  • tools/send_message_tool.py — Added iMessage routing and send function
  • tools/cronjob_tools.py — Added to delivery description
  • hermes_cli/status.py — Added to platform status display
  • hermes_cli/config.py — Added BLUEBUBBLES_PASSWORD to sensitive vars
  • hermes_cli/skills_config.py — Added platform label
  • hermes_cli/tools_config.py — Added platform toolset mapping
  • gateway/channel_directory.py — Added to session discovery list

Design Notes

  • Uses polling (not webhooks) for message retrieval, consistent with how BlueBubbles exposes its REST API
  • Message deduplication is handled via a GUID set (capped at 500 entries) plus timestamp offset (+1ms) to avoid boundary re-fetches
  • The adapter gracefully handles the absence of httpx at import time, so it won't break installations that don't need iMessage

Testing

  • Tested locally on macOS with BlueBubbles Server
  • Verified send/receive for text, images, and reactions
  • Confirmed no regressions on other platform adapters

Adds a complete iMessage platform adapter that integrates with BlueBubbles Server
to enable Hermes to send and receive messages through Apple's iMessage.

Features:
- Full text messaging (send/receive) via BlueBubbles REST API
- Media support: images, voice messages, videos, and file attachments
- Tapback reactions (love, like, dislike, laugh, emphasize, question)
- Read receipts
- Group chat support
- Polling-based message retrieval with GUID deduplication
- Interactive CLI setup flow

Requires BlueBubbles Server running on a Mac with:
- BLUEBUBBLES_SERVER_URL: BlueBubbles server URL
- BLUEBUBBLES_PASSWORD: BlueBubbles server password
- IMESSAGE_HOME_CHANNEL (optional): default chat GUID
benjaminsehl pushed a commit to benjaminsehl/hermes-agent that referenced this pull request Apr 7, 2026
…adapter

Incorporates features from PR NousResearch#4588 while keeping our webhook
architecture and helper-connection safety checks:

- Media attachments: send_image, send_voice, send_video, send_document,
  send_animation via BlueBubbles multipart upload API
- Tapback reactions: send_reaction() with Private API helper guard
- Typing indicators: send_typing() / stop_typing() with helper guard
- Read receipts: mark_read() fired automatically after inbound messages
- Log redaction: phone numbers and emails masked in log output
- GUID cache: avoid repeated chat/query API calls per conversation
- Enhanced get_chat_info: queries BlueBubbles for display names and
  participant lists instead of just inferring from the GUID
- Skip inbound tapback reactions (associatedMessageType codes)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
teknium1 added a commit that referenced this pull request Apr 9, 2026
Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR #5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR #4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
teknium1 added a commit that referenced this pull request Apr 9, 2026
Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR #5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR #4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
@teknium1

teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Merged via PR #6437. Your inbound attachment downloading (image/audio/document cache routing via the BlueBubbles attachment API) was integrated into the consolidated adapter. Thank you @1960697431!

@teknium1 teknium1 closed this Apr 9, 2026
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…h#6437)

Adds Apple iMessage as a gateway platform via BlueBubbles macOS server.

Architecture:
- Webhook-based inbound (event-driven, no polling/dedup needed)
- Email/phone → chat GUID resolution for user-friendly addressing
- Private API safety (checks helper_connected before tapback/typing)
- Inbound attachment downloading (images, audio, documents cached locally)
- Markdown stripping for clean iMessage delivery
- Smart progress suppression for platforms without message editing

Based on PR NousResearch#5869 by @benjaminsehl (webhook architecture, GUID resolution,
Private API safety, progress suppression) with inbound attachment downloading
from PR NousResearch#4588 by @1960697431 (attachment cache routing).

Integration points: Platform enum, env config, adapter factory, auth maps,
cron delivery, send_message routing, channel directory, platform hints,
toolset definition, setup wizard, status display.

27 tests covering config, adapter, webhook parsing, GUID resolution,
attachment download routing, toolset consistency, and prompt hints.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants