mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 16:01:49 +08:00
Compare commits
1 Commits
fix/plugin
...
hermes/her
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20d96215e7 |
@@ -1981,6 +1981,36 @@ def _setup_whatsapp():
|
|||||||
cmd_whatsapp(argparse.Namespace())
|
cmd_whatsapp(argparse.Namespace())
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_email():
|
||||||
|
"""Configure Email via the standard platform setup."""
|
||||||
|
email_platform = next(p for p in _PLATFORMS if p["key"] == "email")
|
||||||
|
_setup_standard_platform(email_platform)
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_sms():
|
||||||
|
"""Configure SMS (Twilio) via the standard platform setup."""
|
||||||
|
sms_platform = next(p for p in _PLATFORMS if p["key"] == "sms")
|
||||||
|
_setup_standard_platform(sms_platform)
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_dingtalk():
|
||||||
|
"""Configure DingTalk via the standard platform setup."""
|
||||||
|
dingtalk_platform = next(p for p in _PLATFORMS if p["key"] == "dingtalk")
|
||||||
|
_setup_standard_platform(dingtalk_platform)
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_feishu():
|
||||||
|
"""Configure Feishu / Lark via the standard platform setup."""
|
||||||
|
feishu_platform = next(p for p in _PLATFORMS if p["key"] == "feishu")
|
||||||
|
_setup_standard_platform(feishu_platform)
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_wecom():
|
||||||
|
"""Configure WeCom (Enterprise WeChat) via the standard platform setup."""
|
||||||
|
wecom_platform = next(p for p in _PLATFORMS if p["key"] == "wecom")
|
||||||
|
_setup_standard_platform(wecom_platform)
|
||||||
|
|
||||||
|
|
||||||
def _is_service_installed() -> bool:
|
def _is_service_installed() -> bool:
|
||||||
"""Check if the gateway is installed as a system service."""
|
"""Check if the gateway is installed as a system service."""
|
||||||
if supports_systemd_services():
|
if supports_systemd_services():
|
||||||
|
|||||||
@@ -1969,6 +1969,42 @@ def _setup_weixin():
|
|||||||
_gateway_setup_weixin()
|
_gateway_setup_weixin()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_signal():
|
||||||
|
"""Configure Signal via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_signal as _gateway_setup_signal
|
||||||
|
_gateway_setup_signal()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_email():
|
||||||
|
"""Configure Email via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_email as _gateway_setup_email
|
||||||
|
_gateway_setup_email()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_sms():
|
||||||
|
"""Configure SMS (Twilio) via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_sms as _gateway_setup_sms
|
||||||
|
_gateway_setup_sms()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_dingtalk():
|
||||||
|
"""Configure DingTalk via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_dingtalk as _gateway_setup_dingtalk
|
||||||
|
_gateway_setup_dingtalk()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_feishu():
|
||||||
|
"""Configure Feishu / Lark via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_feishu as _gateway_setup_feishu
|
||||||
|
_gateway_setup_feishu()
|
||||||
|
|
||||||
|
|
||||||
|
def _setup_wecom():
|
||||||
|
"""Configure WeCom (Enterprise WeChat) via gateway setup."""
|
||||||
|
from hermes_cli.gateway import _setup_wecom as _gateway_setup_wecom
|
||||||
|
_gateway_setup_wecom()
|
||||||
|
|
||||||
|
|
||||||
def _setup_bluebubbles():
|
def _setup_bluebubbles():
|
||||||
"""Configure BlueBubbles iMessage gateway."""
|
"""Configure BlueBubbles iMessage gateway."""
|
||||||
print_header("BlueBubbles (iMessage)")
|
print_header("BlueBubbles (iMessage)")
|
||||||
@@ -2085,9 +2121,15 @@ _GATEWAY_PLATFORMS = [
|
|||||||
("Telegram", "TELEGRAM_BOT_TOKEN", _setup_telegram),
|
("Telegram", "TELEGRAM_BOT_TOKEN", _setup_telegram),
|
||||||
("Discord", "DISCORD_BOT_TOKEN", _setup_discord),
|
("Discord", "DISCORD_BOT_TOKEN", _setup_discord),
|
||||||
("Slack", "SLACK_BOT_TOKEN", _setup_slack),
|
("Slack", "SLACK_BOT_TOKEN", _setup_slack),
|
||||||
|
("Signal", "SIGNAL_HTTP_URL", _setup_signal),
|
||||||
|
("Email", "EMAIL_ADDRESS", _setup_email),
|
||||||
|
("SMS (Twilio)", "TWILIO_ACCOUNT_SID", _setup_sms),
|
||||||
("Matrix", "MATRIX_ACCESS_TOKEN", _setup_matrix),
|
("Matrix", "MATRIX_ACCESS_TOKEN", _setup_matrix),
|
||||||
("Mattermost", "MATTERMOST_TOKEN", _setup_mattermost),
|
("Mattermost", "MATTERMOST_TOKEN", _setup_mattermost),
|
||||||
("WhatsApp", "WHATSAPP_ENABLED", _setup_whatsapp),
|
("WhatsApp", "WHATSAPP_ENABLED", _setup_whatsapp),
|
||||||
|
("DingTalk", "DINGTALK_CLIENT_ID", _setup_dingtalk),
|
||||||
|
("Feishu / Lark", "FEISHU_APP_ID", _setup_feishu),
|
||||||
|
("WeCom (Enterprise WeChat)", "WECOM_BOT_ID", _setup_wecom),
|
||||||
("Weixin (WeChat)", "WEIXIN_ACCOUNT_ID", _setup_weixin),
|
("Weixin (WeChat)", "WEIXIN_ACCOUNT_ID", _setup_weixin),
|
||||||
("BlueBubbles (iMessage)", "BLUEBUBBLES_SERVER_URL", _setup_bluebubbles),
|
("BlueBubbles (iMessage)", "BLUEBUBBLES_SERVER_URL", _setup_bluebubbles),
|
||||||
("Webhooks (GitHub, GitLab, etc.)", "WEBHOOK_ENABLED", _setup_webhooks),
|
("Webhooks (GitHub, GitLab, etc.)", "WEBHOOK_ENABLED", _setup_webhooks),
|
||||||
@@ -2129,10 +2171,17 @@ def setup_gateway(config: dict):
|
|||||||
get_env_value("TELEGRAM_BOT_TOKEN")
|
get_env_value("TELEGRAM_BOT_TOKEN")
|
||||||
or get_env_value("DISCORD_BOT_TOKEN")
|
or get_env_value("DISCORD_BOT_TOKEN")
|
||||||
or get_env_value("SLACK_BOT_TOKEN")
|
or get_env_value("SLACK_BOT_TOKEN")
|
||||||
|
or get_env_value("SIGNAL_HTTP_URL")
|
||||||
|
or get_env_value("EMAIL_ADDRESS")
|
||||||
|
or get_env_value("TWILIO_ACCOUNT_SID")
|
||||||
or get_env_value("MATTERMOST_TOKEN")
|
or get_env_value("MATTERMOST_TOKEN")
|
||||||
or get_env_value("MATRIX_ACCESS_TOKEN")
|
or get_env_value("MATRIX_ACCESS_TOKEN")
|
||||||
or get_env_value("MATRIX_PASSWORD")
|
or get_env_value("MATRIX_PASSWORD")
|
||||||
or get_env_value("WHATSAPP_ENABLED")
|
or get_env_value("WHATSAPP_ENABLED")
|
||||||
|
or get_env_value("DINGTALK_CLIENT_ID")
|
||||||
|
or get_env_value("FEISHU_APP_ID")
|
||||||
|
or get_env_value("WECOM_BOT_ID")
|
||||||
|
or get_env_value("WEIXIN_ACCOUNT_ID")
|
||||||
or get_env_value("BLUEBUBBLES_SERVER_URL")
|
or get_env_value("BLUEBUBBLES_SERVER_URL")
|
||||||
or get_env_value("WEBHOOK_ENABLED")
|
or get_env_value("WEBHOOK_ENABLED")
|
||||||
)
|
)
|
||||||
@@ -2321,12 +2370,30 @@ def _get_section_config_summary(config: dict, section_key: str) -> Optional[str]
|
|||||||
platforms.append("Discord")
|
platforms.append("Discord")
|
||||||
if get_env_value("SLACK_BOT_TOKEN"):
|
if get_env_value("SLACK_BOT_TOKEN"):
|
||||||
platforms.append("Slack")
|
platforms.append("Slack")
|
||||||
if get_env_value("WHATSAPP_PHONE_NUMBER_ID"):
|
|
||||||
platforms.append("WhatsApp")
|
|
||||||
if get_env_value("SIGNAL_ACCOUNT"):
|
if get_env_value("SIGNAL_ACCOUNT"):
|
||||||
platforms.append("Signal")
|
platforms.append("Signal")
|
||||||
|
if get_env_value("EMAIL_ADDRESS"):
|
||||||
|
platforms.append("Email")
|
||||||
|
if get_env_value("TWILIO_ACCOUNT_SID"):
|
||||||
|
platforms.append("SMS")
|
||||||
|
if get_env_value("MATRIX_ACCESS_TOKEN") or get_env_value("MATRIX_PASSWORD"):
|
||||||
|
platforms.append("Matrix")
|
||||||
|
if get_env_value("MATTERMOST_TOKEN"):
|
||||||
|
platforms.append("Mattermost")
|
||||||
|
if get_env_value("WHATSAPP_PHONE_NUMBER_ID"):
|
||||||
|
platforms.append("WhatsApp")
|
||||||
|
if get_env_value("DINGTALK_CLIENT_ID"):
|
||||||
|
platforms.append("DingTalk")
|
||||||
|
if get_env_value("FEISHU_APP_ID"):
|
||||||
|
platforms.append("Feishu")
|
||||||
|
if get_env_value("WECOM_BOT_ID"):
|
||||||
|
platforms.append("WeCom")
|
||||||
|
if get_env_value("WEIXIN_ACCOUNT_ID"):
|
||||||
|
platforms.append("Weixin")
|
||||||
if get_env_value("BLUEBUBBLES_SERVER_URL"):
|
if get_env_value("BLUEBUBBLES_SERVER_URL"):
|
||||||
platforms.append("BlueBubbles")
|
platforms.append("BlueBubbles")
|
||||||
|
if get_env_value("WEBHOOK_ENABLED"):
|
||||||
|
platforms.append("Webhooks")
|
||||||
if platforms:
|
if platforms:
|
||||||
return ", ".join(platforms)
|
return ", ".join(platforms)
|
||||||
return None # No platforms configured — section must run
|
return None # No platforms configured — section must run
|
||||||
|
|||||||
@@ -178,6 +178,8 @@ EMAIL_ALLOWED_USERS=trusted@example.com,colleague@work.com
|
|||||||
MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c
|
MATTERMOST_ALLOWED_USERS=3uo8dkh1p7g1mfk49ear5fzs5c
|
||||||
MATRIX_ALLOWED_USERS=@alice:matrix.org
|
MATRIX_ALLOWED_USERS=@alice:matrix.org
|
||||||
DINGTALK_ALLOWED_USERS=user-id-1
|
DINGTALK_ALLOWED_USERS=user-id-1
|
||||||
|
FEISHU_ALLOWED_USERS=ou_xxxxxxxx,ou_yyyyyyyy
|
||||||
|
WECOM_ALLOWED_USERS=user-id-1,user-id-2
|
||||||
|
|
||||||
# Or allow
|
# Or allow
|
||||||
GATEWAY_ALLOWED_USERS=123456789,987654321
|
GATEWAY_ALLOWED_USERS=123456789,987654321
|
||||||
|
|||||||
Reference in New Issue
Block a user