mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-30 06:41:51 +00:00
ntfy now ships as a self-contained plugin under plugins/platforms/ntfy/ instead of editing 8 core files (gateway/config.py Platform enum, gateway/run.py factory + auth maps, cron/scheduler.py, toolsets.py, hermes_cli/status.py, agent/prompt_builder.py, gateway/channel_directory.py, tools/send_message_tool.py). All routing goes through gateway/platform_registry via register_platform(): - adapter_factory, check_fn, validate_config, is_connected - env_enablement_fn seeds PlatformConfig.extra from NTFY_* env vars so gateway status reflects env-only setups without instantiating httpx - standalone_sender_fn handles deliver=ntfy cron jobs when cron runs out-of-process from the gateway - allowed_users_env / allow_all_env hook into _is_user_authorized - cron_deliver_env_var=NTFY_HOME_CHANNEL for cron home routing - platform_hint surfaces in the system prompt - pii_safe=True (topic names are the only identifier; no PII to redact) Tests moved to tests/gateway/test_ntfy_plugin.py using _plugin_adapter_loader so the module lives under plugin_adapter_ntfy in sys.modules and cannot collide with sibling plugin-adapter tests on the same xdist worker. The core-file grep tests (Platform.NTFY in source, hermes-ntfy in toolsets, etc.) are replaced with plugin-shape tests covering register() metadata, env_enablement_fn output, and standalone_sender_fn behavior. 68 tests pass under scripts/run_tests.sh.
56 lines
2.2 KiB
YAML
56 lines
2.2 KiB
YAML
name: ntfy-platform
|
|
label: ntfy
|
|
kind: platform
|
|
version: 1.0.0
|
|
description: >
|
|
ntfy push-notification gateway adapter for Hermes Agent.
|
|
Subscribes to a topic on ntfy.sh or any self-hosted ntfy server via
|
|
HTTP streaming, and publishes replies via HTTP POST. Lightweight —
|
|
no external SDK, only httpx (already a Hermes dependency).
|
|
|
|
ntfy has no native user-identity primitive; the adapter treats each
|
|
topic as a single trusted channel and never derives user identity
|
|
from publisher-controlled fields. Use a private topic + read token
|
|
for any real trust boundary.
|
|
author: sprmn24
|
|
# ``requires_env`` and ``optional_env`` entries are surfaced in the
|
|
# ``hermes config`` UI via the platform-plugin env var injector in
|
|
# ``hermes_cli/config.py``.
|
|
requires_env:
|
|
- name: NTFY_TOPIC
|
|
description: "Topic name to subscribe to (e.g. hermes-in)"
|
|
prompt: "ntfy subscribe topic"
|
|
password: false
|
|
optional_env:
|
|
- name: NTFY_SERVER_URL
|
|
description: "ntfy server URL (default: https://ntfy.sh)"
|
|
prompt: "ntfy server URL"
|
|
password: false
|
|
- name: NTFY_TOKEN
|
|
description: "Bearer token or 'user:pass' for Basic auth (optional)"
|
|
prompt: "ntfy auth token (or empty)"
|
|
password: true
|
|
- name: NTFY_PUBLISH_TOPIC
|
|
description: "Topic to publish replies to (defaults to NTFY_TOPIC)"
|
|
prompt: "ntfy publish topic (or empty)"
|
|
password: false
|
|
- name: NTFY_MARKDOWN
|
|
description: "Send replies with X-Markdown: true header (true/false, default: false)"
|
|
prompt: "Enable markdown formatting? (true/false)"
|
|
password: false
|
|
- name: NTFY_ALLOWED_USERS
|
|
description: "Comma-separated topic names allowed (allowlist)"
|
|
prompt: "Allowed topic names (comma-separated)"
|
|
password: false
|
|
- name: NTFY_ALLOW_ALL_USERS
|
|
description: "Allow any topic to talk to the bot (dev only — disables allowlist)"
|
|
prompt: "Allow all topics? (true/false)"
|
|
password: false
|
|
- name: NTFY_HOME_CHANNEL
|
|
description: "Default topic for cron / notification delivery"
|
|
prompt: "Home channel topic (or empty)"
|
|
password: false
|
|
- name: NTFY_HOME_CHANNEL_NAME
|
|
description: "Human label for the home channel (defaults to the topic name)"
|
|
prompt: "Home channel display name (or empty)"
|
|
password: false
|