src/plugin
AppKit plugin (registered name: teams) that owns the Teams Adaptive Card
runtime - the resolved card version and the optional incoming-webhook URL the
AppKit teams.createCard tool and routes read. Registering it resolves and
logs the effective config (which card version is in force, whether a webhook
is wired up) so a misconfiguration is visible in the boot logs rather than
on the first card. The plugin’s execute() is captured by its own runtime so
every build / post picks up AppKit’s cache / retry / timeout / telemetry
chain.
The plugin is also a ToolProvider, so an AppKit agent can reach a
teams.createCard tool directly. App-integrated Mastra agents consume this
provider through plugins.teams.toolkit(); the teamsCardTool factory
is the standalone surface and uses an explicit runtime or isolated config.
The plugin mounts four routes under its base path (/api/teams):
POST /messagesis the REAL Microsoft Teams messaging endpoint - the URL an Azure Bot registration points at. It validates the Bot Service JWT, acknowledges immediately, and delivers the agent’s card back over the Connector API. This is the route that makes a Teams channel able to chat with the app’s agents, the same way the Mastra plugin exposes MCP at a path.POST /activityruns the same turn SYNCHRONOUSLY, answering with the reply activities in the response body. It needs no bot registration, so it is what a local client (the in-repo preview chat), a test, or any non-Teams caller uses.POST /cardcompiles a card.CardSpec into an Adaptive Card document (the preview page posts here).POST /postpushes a compiled card to the configured Teams incoming webhook when one is set.
Mirrors the node-email add-on’s shape.