@mastra/discord 0.0.0 → 1.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1 +1,39 @@
1
1
  # @mastra/discord
2
+
3
+ ## 1.1.0-alpha.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `@mastra/discord` for connecting Mastra agents to Discord. One Discord app serves many servers, and agents respond to slash commands, DMs, and @mentions. Set `encryptionKey` or `MASTRA_ENCRYPTION_KEY` to encrypt the stored bot token at rest. ([#25002](https://github.com/mastra-ai/mastra/pull/25002))
8
+
9
+ ```ts
10
+ import { Mastra } from '@mastra/core';
11
+ import { DiscordProvider } from '@mastra/discord';
12
+
13
+ // App credentials from the Discord Developer Portal (or the DISCORD_BOT_TOKEN /
14
+ // DISCORD_PUBLIC_KEY / DISCORD_APPLICATION_ID env vars):
15
+ const discord = new DiscordProvider({
16
+ app: {
17
+ botToken: process.env.DISCORD_BOT_TOKEN!,
18
+ publicKey: process.env.DISCORD_PUBLIC_KEY!,
19
+ applicationId: process.env.DISCORD_APPLICATION_ID!,
20
+ },
21
+ });
22
+
23
+ export const mastra = new Mastra({
24
+ agents: { support },
25
+ channels: { discord },
26
+ });
27
+
28
+ // Bind an agent. If the bot is already in DISCORD_GUILD_ID, this binds the
29
+ // agent to that guild and registers its slash commands immediately. Otherwise
30
+ // it returns an OAuth2 bot-invite URL and the install stays pending until the
31
+ // bot joins a guild — the first interaction from that guild activates it.
32
+ const result = await discord.connect('support', { guildId: process.env.DISCORD_GUILD_ID });
33
+ // → { type: 'immediate' } OR { type: 'oauth', authorizationUrl, installationId }
34
+ ```
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [[`fc7d2c1`](https://github.com/mastra-ai/mastra/commit/fc7d2c102e911f43f70f425e67c970231ea19363), [`4607046`](https://github.com/mastra-ai/mastra/commit/460704663e2869183e7dfff7efec49a4f2f47503), [`1e435dc`](https://github.com/mastra-ai/mastra/commit/1e435dc84a9c1b35aa58d0ab9b14ff39fe13aab0), [`9ba23a2`](https://github.com/mastra-ai/mastra/commit/9ba23a23893622b72c76189199d02432590606c1)]:
39
+ - @mastra/core@1.71.0-alpha.1
package/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named `ee/` within this
4
+ repository, including but not limited to:
5
+ - `@mastra/core/auth/ee`
6
+ - `@mastra/core/agent-builder/ee`
7
+ - `@mastra/editor/ee`
8
+
9
+ is licensed under the license defined in [`ee/LICENSE`](https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE).
10
+
11
+ - All third-party components incorporated into the Mastra Software are
12
+ licensed under the original license provided by the owner of the
13
+ applicable component.
14
+
15
+ - Content outside of the above-mentioned directories or restrictions is
16
+ available under the "Apache License 2.0" as defined below.
17
+
18
+ # Apache License 2.0
19
+
20
+ Copyright (c) 2025 Kepler Software, Inc.
21
+
22
+ Licensed under the Apache License, Version 2.0 (the "License");
23
+ you may not use this file except in compliance with the License.
24
+ You may obtain a copy of the License at
25
+
26
+ http://www.apache.org/licenses/LICENSE-2.0
27
+
28
+ Unless required by applicable law or agreed to in writing, software
29
+ distributed under the License is distributed on an "AS IS" BASIS,
30
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31
+ See the License for the specific language governing permissions and
32
+ limitations under the License.