@mastra/slack 1.7.0 → 1.7.1-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/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -245,9 +245,9 @@ const ALGO_PREFIX = "aes-256-gcm-hkdf";
|
|
|
245
245
|
* Returns: `aes-256-gcm-hkdf:base64(salt):base64(iv):base64(authTag):base64(ciphertext)`
|
|
246
246
|
*/
|
|
247
247
|
function encrypt(plaintext, key) {
|
|
248
|
-
const salt = (
|
|
248
|
+
const salt = Buffer.from(globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)));
|
|
249
249
|
const derived = Buffer.from((0, crypto.hkdfSync)("sha256", key, salt, "mastra-slack-encryption", 32));
|
|
250
|
-
const iv = (
|
|
250
|
+
const iv = Buffer.from(globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(12)));
|
|
251
251
|
const cipher = (0, crypto.createCipheriv)("aes-256-gcm", derived, iv);
|
|
252
252
|
const encrypted = Buffer.concat([cipher.update(plaintext, "utf8"), cipher.final()]);
|
|
253
253
|
const authTag = cipher.getAuthTag();
|
|
@@ -6008,7 +6008,7 @@ var SlackProvider = class {
|
|
|
6008
6008
|
}
|
|
6009
6009
|
if (existingRecord?.status === "active") throw new Error(`Agent "${agentId}" is already connected to Slack. Disconnect first to reconnect.`);
|
|
6010
6010
|
const config = options ?? {};
|
|
6011
|
-
const webhookId = crypto.randomUUID();
|
|
6011
|
+
const webhookId = globalThis.crypto.randomUUID();
|
|
6012
6012
|
const appName = config.name ?? agent?.name ?? agentId;
|
|
6013
6013
|
const appDescription = config.description || agent?.getDescription() || "AI assistant powered by Mastra";
|
|
6014
6014
|
const normalizedCommands = this.#normalizeCommands(config.slashCommands);
|
|
@@ -6034,7 +6034,7 @@ var SlackProvider = class {
|
|
|
6034
6034
|
} catch (error) {
|
|
6035
6035
|
console.warn(`[Slack] Failed to set app icon for "${agentId}":`, error);
|
|
6036
6036
|
}
|
|
6037
|
-
const installationId = crypto.randomUUID();
|
|
6037
|
+
const installationId = globalThis.crypto.randomUUID();
|
|
6038
6038
|
const scopes = manifest.oauth_config?.scopes?.bot?.join(",") ?? "";
|
|
6039
6039
|
const slackBaseUrl = appCredentials.oauthAuthorizeUrl ?? `https://slack.com/oauth/v2/authorize?client_id=${appCredentials.clientId}&scope=${encodeURIComponent(scopes)}`;
|
|
6040
6040
|
const authUrl = new URL(slackBaseUrl);
|