Follow-up to the salvaged #113591 gate: - Teams writes the bot's conversation identity as `28:<app id>` (activity.recipient.id, mention entities) while App.id is the bare app id. The mention match and the own-message filter now accept both spellings, so a real tenant mention no longer fails silently. - A payload that mentions only other people is no longer treated as a bot mention; the `<at>` text fallback applies only when the activity carries no mention entities at all. - `self._extra` holds `platforms.teams.extra` on the instance so keys read after construction (require_mention today) are not dropped with a constructor local (#114366). - Reply exemption uses one bounded deque instead of deque + mirror set. - Tests trimmed to two invariants: gate table (drop before attachment download / keep mention, reply-to-bot, personal) and env-over-YAML precedence. TEAMS_REQUIRE_MENTION documented in plugin.yaml and the Teams docs page. Co-authored-by: Kevin Rajan <7121943+kvnloo@users.noreply.github.com> Co-authored-by: finn763 <165816600+finn763@users.noreply.github.com> Co-authored-by: Fernando Muñoz Suazo <fernandrewm@gmail.com>
57 lines
2.3 KiB
YAML
57 lines
2.3 KiB
YAML
name: teams-platform
|
|
label: Microsoft Teams
|
|
kind: platform
|
|
version: 1.0.0
|
|
description: >
|
|
Microsoft Teams gateway adapter for Hermes Agent.
|
|
Connects to Microsoft Teams via the Bot Framework and relays messages
|
|
between Teams chats (personal DMs, group chats, channel posts) and
|
|
the Hermes agent. Supports Adaptive Card approval prompts.
|
|
author: Aamir Jawaid
|
|
# ``requires_env`` entries are surfaced in ``hermes config`` UI via the
|
|
# platform-plugin env var injector in ``hermes_cli/config.py``.
|
|
requires_env:
|
|
- name: TEAMS_CLIENT_ID
|
|
description: "Azure AD application (Bot Framework) client ID"
|
|
prompt: "Teams / Azure AD client ID"
|
|
url: "https://portal.azure.com/"
|
|
password: false
|
|
- name: TEAMS_CLIENT_SECRET
|
|
description: "Azure AD application client secret"
|
|
prompt: "Teams / Azure AD client secret"
|
|
url: "https://portal.azure.com/"
|
|
password: true
|
|
- name: TEAMS_TENANT_ID
|
|
description: "Azure AD tenant ID hosting the bot application"
|
|
prompt: "Teams / Azure AD tenant ID"
|
|
password: false
|
|
optional_env:
|
|
- name: TEAMS_PORT
|
|
description: "Webhook listen port (Bot Framework default: 3978)"
|
|
prompt: "Webhook port"
|
|
password: false
|
|
- name: TEAMS_HOST
|
|
description: "Webhook bind host (default: unset → dual-stack, all interfaces IPv4+IPv6)"
|
|
prompt: "Webhook host"
|
|
password: false
|
|
- name: TEAMS_ALLOWED_USERS
|
|
description: "Comma-separated Teams user IDs / UPNs allowed to talk to the bot"
|
|
prompt: "Allowed users (comma-separated)"
|
|
password: false
|
|
- name: TEAMS_ALLOW_ALL_USERS
|
|
description: "Allow any Teams user to trigger the bot (dev only)"
|
|
prompt: "Allow all users? (true/false)"
|
|
password: false
|
|
- name: TEAMS_REQUIRE_MENTION
|
|
description: "Only answer channel/group-chat messages that @mention the bot or reply to it (default false; needed once the app has RSC message-read consent)"
|
|
prompt: "Require @mention in channels and group chats? (true/false)"
|
|
password: false
|
|
- name: TEAMS_HOME_CHANNEL
|
|
description: "Default chat/channel ID for cron / notification delivery"
|
|
prompt: "Home channel (or empty)"
|
|
password: false
|
|
- name: TEAMS_HOME_CHANNEL_NAME
|
|
description: "Display name for the Teams home channel"
|
|
prompt: "Home channel display name"
|
|
password: false
|