50 lines
2.9 KiB
Python
50 lines
2.9 KiB
Python
"""
|
|
Shared platform registry for Hermes Agent.
|
|
|
|
Single source of truth for platform metadata consumed by both
|
|
skills_config (label display) and tools_config (default toolset
|
|
resolution). Import ``PLATFORMS`` from here instead of maintaining
|
|
duplicate dicts in each module.
|
|
"""
|
|
|
|
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")),
|
|
("signal", PlatformInfo(label="๐ก Signal", default_toolset="hermes-signal")),
|
|
("bluebubbles", PlatformInfo(label="๐ BlueBubbles", default_toolset="hermes-bluebubbles")),
|
|
("email", PlatformInfo(label="๐ง Email", default_toolset="hermes-email")),
|
|
("homeassistant", PlatformInfo(label="๐ Home Assistant", default_toolset="hermes-homeassistant")),
|
|
("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 platform_label(key: str, default: str = "") -> str:
|
|
"""Return the display label for a platform key, or *default*."""
|
|
info = PLATFORMS.get(key)
|
|
return info.label if info is not None else default
|