The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(bluebubbles): drop core wiring
Tekniumfc6d67947235
diff --git a/gateway/run.py b/gateway/run.pyindex cdb95adc49a..8e0baf76c3e 100644--- a/gateway/run.py+++ b/gateway/run.py@@ -3329,8 +3329,6 @@ _BUILTIN_ADAPTERS: dict[Platform, tuple[str, str, str, str]] = {"Webhook: aiohttp not installed"),Platform.MSGRAPH_WEBHOOK: ("msgraph_webhook", "MSGraphWebhookAdapter", "check_msgraph_webhook_requirements","MSGraph webhook: aiohttp not installed"),- Platform.BLUEBUBBLES: ("bluebubbles", "BlueBubblesAdapter", "check_bluebubbles_requirements",- "BlueBubbles: aiohttp/httpx missing or BLUEBUBBLES_SERVER_URL/BLUEBUBBLES_PASSWORD not configured"),Platform.QQBOT: ("qqbot", "QQAdapter", "check_qq_requirements","QQBot: aiohttp/httpx missing or QQ_APP_ID/QQ_CLIENT_SECRET not configured"),Platform.YUANBAO: ("yuanbao", "YuanbaoAdapter", "WEBSOCKETS_AVAILABLE",diff --git a/hermes_cli/gateway_setup_wizard.py b/hermes_cli/gateway_setup_wizard.pyindex dd296a24a71..cf3ed63a9ab 100644--- a/hermes_cli/gateway_setup_wizard.py+++ b/hermes_cli/gateway_setup_wizard.py@@ -51,36 +51,6 @@ _PLATFORMS = [},{"key": "signal", "label": "Signal", "emoji": "π‘", "token_var": "SIGNAL_HTTP_URL"},{"key": "weixin", "label": "Weixin / WeChat", "emoji": "π¬", "token_var": "WEIXIN_ACCOUNT_ID"},- {- "key": "bluebubbles", "label": "BlueBubbles (iMessage)",- "emoji": "π¬", "token_var": "BLUEBUBBLES_SERVER_URL",- "setup_instructions": [- "1. Install BlueBubbles on a Mac that will act as your iMessage server:",- " https://bluebubbles.app/",- "2. Complete the BlueBubbles setup wizard β sign in with your Apple ID",- "3. In BlueBubbles Settings β API, note the Server URL and password",- "4. The server URL is typically http://<your-mac-ip>:1234",- "5. Hermes connects via the BlueBubbles REST API and receives",- " incoming messages via a local webhook",- "6. To authorize users, use DM pairing: hermes pairing generate bluebubbles",- " Share the code β the user sends it via iMessage to get approved",- ],- "vars": [- {"name": "BLUEBUBBLES_SERVER_URL",- "prompt": "BlueBubbles server URL (e.g. http://192.168.1.10:1234)", "password": False,- "help": "The URL shown in BlueBubbles Settings β API."},- {"name": "BLUEBUBBLES_PASSWORD", "prompt": "BlueBubbles server password", "password": True,- "help": "The password shown in BlueBubbles Settings β API."},- {"name": "BLUEBUBBLES_ALLOWED_USERS",- "prompt": "Pre-authorized phone numbers or iMessage IDs (comma-separated, or leave empty for DM pairing)",- "password": False, "is_allowlist": True,- "help": "Optional β pre-authorize specific users. Leave empty to use DM pairing instead (recommended)."},- {"name": "BLUEBUBBLES_HOME_CHANNEL",- "prompt": "Home channel (phone number or iMessage ID for cron/notifications, or empty)",- "password": False,- "help": "Phone number or Apple ID to deliver cron results and notifications to."},- ],- },{"key": "qqbot", "label": "QQ Bot", "emoji": "π§", "token_var": "QQ_APP_ID","setup_instructions": [@@ -702,7 +672,6 @@ def _builtin_setup_fn(key: str):from hermes_cli import setup as _sreturn {# telegram/discord/slack/whatsapp/dingtalk/feishu/wecom setup_fns come from their plugins.- "bluebubbles": _gw().setup_platforms._setup_bluebubbles,"webhooks": _gw().setup_platforms._setup_webhooks,"signal": _setup_signal,"weixin": _setup_weixin,diff --git a/hermes_cli/setup_platforms.py b/hermes_cli/setup_platforms.pyindex 70df774aa6f..ea67d35455d 100644--- a/hermes_cli/setup_platforms.py+++ b/hermes_cli/setup_platforms.py@@ -1,4 +1,4 @@-"""Messaging-platform setup wizards (Telegram, BlueBubbles, webhooks) and the ``hermes setup+"""Messaging-platform setup wizards (Telegram, webhooks) and the ``hermes setupgateway`` flow. setup.py re-exports the public names, and tests monkeypatch prompt/print/envhelpers on hermes_cli.setup, so those are imported lazily per function."""@@ -187,39 +187,7 @@ def _setup_telegram():# _setup_slack and _write_slack_manifest_and_instruct moved to the slack plugin:# plugins/platforms/slack/adapter.py::interactive_setup (registered via setup_fn and dispatched through the# plugin path). #41112 / #3823.-def _setup_bluebubbles():- """Configure BlueBubbles iMessage gateway."""- from hermes_cli.setup import _info, print_header, print_success, prompt, prompt_yes_no- print_header("BlueBubbles (iMessage)")- if declines_reconfigure("BlueBubbles", "Reconfigure BlueBubbles?", "BLUEBUBBLES_SERVER_URL"):- return- _info("Connects Hermes to iMessage via BlueBubbles β a free, open-source",- "macOS server that bridges iMessage to any device.",- " Requires a Mac running BlueBubbles Server v1.0.0+",- " Download: https://bluebubbles.app/", None,- "In BlueBubbles Server β Settings β API, note your Server URL and Password.", None)- for label, env_var, secret, what, transform in (- ("BlueBubbles server URL (e.g. http://192.168.1.10:1234)", "BLUEBUBBLES_SERVER_URL", False, "Server URL",- lambda v: v.rstrip("/")),- ("BlueBubbles server password", "BLUEBUBBLES_PASSWORD", True, "Password", None),- ):- if not save_prompted(env_var, label, password=secret, transform=transform,- skip_msg=f"{what} is required β skipping BlueBubbles setup"):- return- print_success("BlueBubbles credentials saved")- _info(None, "π Security: Restrict who can message your bot",- " Use iMessage addresses: email ([email protected]) or phone (+15551234567)", None)- _prompt_allowlist("BLUEBUBBLES_ALLOWED_USERS", "Allowed iMessage addresses (comma-separated, leave empty for open access)",- "BlueBubbles allowlist configured", "β οΈ No allowlist set β anyone who can iMessage you can use the bot!")- _info(None, "π¬ Home Channel: phone or email for cron job delivery and notifications.",- " You can also set this later with /set-home in your iMessage chat.")- save_prompted("BLUEBUBBLES_HOME_CHANNEL", "Home channel address (leave empty to set later)")- _info(None, "Advanced settings (defaults are fine for most setups):")- if prompt_yes_no("Configure webhook listener settings?", False):- _save_port("BLUEBUBBLES_WEBHOOK_PORT", prompt("Webhook listener port (default: 8645)"), "8645")- _info(None, "Requires the BlueBubbles Private API helper for typing indicators,",- "read receipts, and tapback reactions. Basic messaging works without it.",- " Install: https://docs.bluebubbles.app/helper-bundle/installation")+# _setup_bluebubbles moved to plugins/platforms/bluebubbles/adapter.py::interactive_setup (setup_fn).def _setup_webhooks():diff --git a/tools/send_message_senders.py b/tools/send_message_senders.pyindex 0e60ba0139e..368c93f6c66 100644--- a/tools/send_message_senders.py+++ b/tools/send_message_senders.py@@ -595,28 +595,6 @@ async def _send_weixin(pconfig, chat_id, message, media_files=None):return _error(f"Weixin send failed: {e}")-async def _send_bluebubbles(extra, chat_id, message):- """Send via BlueBubbles iMessage server using the adapter's REST API."""- bb, err = _gateway_platform_module("bluebubbles", unavailable="BlueBubbles adapter not available.",- unmet="BlueBubbles requirements not met (need aiohttp + httpx).")- if err:- return err- try:- from gateway.config import PlatformConfig- adapter = bb.BlueBubblesAdapter(PlatformConfig(extra=extra))- if not await adapter.connect():- return _error("BlueBubbles: failed to connect to server")- try:- result = await adapter.send(chat_id, message)- finally:- await adapter.disconnect()- if not result.success:- return _error(f"BlueBubbles send failed: {result.error}")- return _success("bluebubbles", chat_id, message_id=result.message_id)- except Exception as e:- return _error(f"BlueBubbles send failed: {e}")--def _qqbot_media_file_type(media_path: str, is_voice: bool) -> int:"""Map a local path / voice flag to QQ Bot ``file_type`` constants."""from gateway.platforms.qqbot.constants import (diff --git a/tools/send_message_tool.py b/tools/send_message_tool.pyindex 28815e637e9..f5f4eb4e035 100644--- a/tools/send_message_tool.py+++ b/tools/send_message_tool.py@@ -17,7 +17,7 @@ from tools.send_message_targets import (from tools.send_message_senders import (_AUDIO_EXTS, _DEFAULT_CAPTION_LIMIT, _IMAGE_EXTS, _NO_DELIVERABLE, _VIDEO_EXTS, _VOICE_EXTS,_adapter_media_method, _error, _live_adapter, _media_caption_split, _plugin_standalone_sender,- _registry_standalone_send, _resolve_slack_user_target, _sanitize_error_text, _send_bluebubbles,+ _registry_standalone_send, _resolve_slack_user_target, _sanitize_error_text,_send_matrix_via_adapter, _send_qqbot, _send_signal, _send_telegram, _send_weixin, _send_yuanbao)from tools.registry import tool_error@@ -679,7 +679,6 @@ _TEXT_SENDERS = {**{name: partial(_registry_standalone_send, name)for name in ("whatsapp", "email", "sms", "dingtalk", "feishu", "wecom")},"signal": lambda pc, cid, chunk, tid: _send_signal(pc.extra, cid, chunk),- "bluebubbles": lambda pc, cid, chunk, tid: _send_bluebubbles(pc.extra, cid, chunk),"qqbot": lambda pc, cid, chunk, tid: _send_qqbot(pc, cid, chunk),"yuanbao": lambda pc, cid, chunk, tid: _send_yuanbao(cid, chunk)}