hermes-agent/gateway/platforms
Teknium 8ffd44a6f9
feat(discord): register skills as native slash commands via shared gateway logic (#5603)
Centralize the skill → slash command registration that Telegram already had
in commands.py so Discord uses the exact same priority system, filtering,
and cap enforcement:

  1. Core/built-in commands (never trimmed)
  2. Plugin commands (never trimmed)
  3. Skill commands (fill remaining slots, alphabetical, only tier trimmed)

Changes:

hermes_cli/commands.py:
  - Rename _TG_NAME_LIMIT → _CMD_NAME_LIMIT (32 chars shared by both platforms)
  - Rename _clamp_telegram_names → _clamp_command_names (generic)
  - Extract _collect_gateway_skill_entries() — shared plugin + skill
    collection with platform filtering, name sanitization, description
    truncation, and cap enforcement
  - Refactor telegram_menu_commands() to use the shared helper
  - Add discord_skill_commands() that returns (name, desc, cmd_key) triples
  - Preserve _sanitize_telegram_name() for Telegram-specific name cleaning

gateway/platforms/discord.py:
  - Call discord_skill_commands() from _register_slash_commands()
  - Create app_commands.Command per skill entry with cmd_key callback
  - Respect 100-command global Discord limit
  - Log warning when skills are skipped due to cap

Backward-compat aliases preserved for _TG_NAME_LIMIT and
_clamp_telegram_names.

Tests: 9 new tests (7 Discord + 2 backward-compat), 98 total pass.

Inspired by PR #5498 (sprmn24). Closes #5480.
2026-04-06 12:09:36 -07:00
..
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
ADDING_A_PLATFORM.md docs: finish cron terminology cleanup 2026-03-14 19:20:58 -07:00
api_server.py fix(gateway): wrap cron helpers with staticmethod to prevent self-binding 2026-04-05 12:31:10 -07:00
base.py feat: shared thread sessions by default — multi-user thread support (#5391) 2026-04-05 19:46:58 -07:00
dingtalk.py fix(dingtalk): requirements check passes with only one credential set 2026-03-17 03:50:45 -07:00
discord.py feat(discord): register skills as native slash commands via shared gateway logic (#5603) 2026-04-06 12:09:36 -07:00
email.py fix(email): close SMTP and IMAP connections on failure (#3804) 2026-03-29 15:38:32 -07:00
feishu.py feat: shared thread sessions by default — multi-user thread support (#5391) 2026-04-05 19:46:58 -07:00
homeassistant.py fix(gateway): add request timeouts to HA, Email, Mattermost, SMS adapters (#3258) 2026-03-26 14:36:07 -07:00
matrix.py feat(matrix): Tier 1 enhancement — reactions, read receipts, rich formatting, room management 2026-04-05 11:19:54 -07:00
mattermost.py fix(gateway): stop Matrix/Mattermost reconnect on permanent auth failures 2026-04-05 11:07:47 -07:00
signal.py fix(signal): implement send_image_file, send_voice, and send_video for MEDIA: tag delivery 2026-04-06 11:41:34 -07:00
slack.py fix: prevent duplicate messages — gateway dedup + partial stream guard (#4878) 2026-04-03 18:53:52 -07:00
sms.py fix: store asyncio task references to prevent GC mid-execution (#3267) 2026-03-26 14:36:24 -07:00
telegram.py feat: shared thread sessions by default — multi-user thread support (#5391) 2026-04-05 19:46:58 -07:00
telegram_network.py fix(security): reject private and loopback IPs in Telegram DoH fallback (#4129) 2026-03-30 18:53:24 -07:00
webhook.py feat: add profiles — run multiple isolated Hermes instances (#3681) 2026-03-29 10:41:20 -07:00
wecom.py feat(gateway): add WeCom (Enterprise WeChat) platform support (#3847) 2026-03-29 21:29:13 -07:00
whatsapp.py fix(whatsapp): add free_response_chats, mention stripping, and interactive message unwrapping 2026-04-03 01:16:39 -07:00