The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
"""Shared platform registry for Hermes Agent."""
from collections import OrderedDict
from typing import NamedTuple
class PlatformInfo(NamedTuple):
"""Metadata for a single platform entry."""
label: str
default_toolset: str
# Ordered so that TUI menus are deterministic.
PLATFORMS: OrderedDict[str, PlatformInfo] = OrderedDict([
("cli", PlatformInfo(label="π₯οΈ CLI", default_toolset="hermes-cli")),
("telegram", PlatformInfo(label="π± Telegram", default_toolset="hermes-telegram")),
("discord", PlatformInfo(label="π¬ Discord", default_toolset="hermes-discord")),
("slack", PlatformInfo(label="πΌ Slack", default_toolset="hermes-slack")),
("whatsapp", PlatformInfo(label="π± WhatsApp", default_toolset="hermes-whatsapp")),
("whatsapp_cloud", PlatformInfo(label="π± WhatsApp Business (Cloud)", default_toolset="hermes-whatsapp")),
("signal", PlatformInfo(label="π‘ Signal", default_toolset="hermes-signal")),
("bluebubbles", PlatformInfo(label="π BlueBubbles", default_toolset="hermes-bluebubbles")),
("email", PlatformInfo(label="π§ Email", default_toolset="hermes-email")),
("mattermost", PlatformInfo(label="π¬ Mattermost", default_toolset="hermes-mattermost")),
("matrix", PlatformInfo(label="π¬ Matrix", default_toolset="hermes-matrix")),
("dingtalk", PlatformInfo(label="π¬ DingTalk", default_toolset="hermes-dingtalk")),
("feishu", PlatformInfo(label="πͺ½ Feishu", default_toolset="hermes-feishu")),
("wecom", PlatformInfo(label="π¬ WeCom", default_toolset="hermes-wecom")),
("wecom_callback", PlatformInfo(label="π¬ WeCom Callback", default_toolset="hermes-wecom-callback")),
("weixin", PlatformInfo(label="π¬ Weixin", default_toolset="hermes-weixin")),
("qqbot", PlatformInfo(label="π¬ QQBot", default_toolset="hermes-qqbot")),
("yuanbao", PlatformInfo(label="π€ Yuanbao", default_toolset="hermes-yuanbao")),
("webhook", PlatformInfo(label="π Webhook", default_toolset="hermes-webhook")),
("api_server", PlatformInfo(label="π API Server", default_toolset="hermes-api-server")),
("cron", PlatformInfo(label="β° Cron", default_toolset="hermes-cron")),
])
def _plugin_label(entry) -> str:
return f"{entry.emoji} {entry.label}" if entry.emoji else entry.label
def platform_label(key: str, default: str = "") -> str:
"""Return the display label for a platform key (builtin, then plugin registry), or *default*."""
info = PLATFORMS.get(key)
if info is not None:
return info.label
try:
from gateway.platform_registry import platform_registry
entry = platform_registry.get(key)
if entry:
return _plugin_label(entry)
except Exception:
pass
return default
def get_all_platforms() -> OrderedDict[str, PlatformInfo]:
"""PLATFORMS plus plugin-registered platforms (appended after builtins) β use for menus."""
merged = OrderedDict(PLATFORMS)
try:
from gateway.platform_registry import platform_registry
for entry in platform_registry.plugin_entries():
if entry.name not in merged:
merged[entry.name] = PlatformInfo(_plugin_label(entry), f"hermes-{entry.name}")
except Exception:
pass
return merged