@mastra/slack 1.7.1 → 1.7.2-alpha.1

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 CHANGED
@@ -5647,11 +5647,15 @@ var SlackProvider = class {
5647
5647
  }
5648
5648
  /**
5649
5649
  * Get the base URL for webhook callbacks.
5650
- * Prefers explicit config, then derives from Mastra server config.
5650
+ * Prefers explicit config, then Mastra server public-URL overrides, then the
5651
+ * `MASTRA_SERVER_URL` env var, then derives from the server bind config.
5651
5652
  */
5652
5653
  #getBaseUrl() {
5653
5654
  if (this.#baseUrl) return stripTrailingSlash(this.#baseUrl);
5654
5655
  const server = this.#mastra?.getServer();
5656
+ const hasPublicOverride = server?.studioHost != null || server?.studioPort != null || server?.studioProtocol != null;
5657
+ const envUrl = process.env.MASTRA_SERVER_URL?.trim();
5658
+ if (!hasPublicOverride && envUrl) return stripTrailingSlash(envUrl);
5655
5659
  const protocol = server?.studioProtocol ?? "http";
5656
5660
  const host = server?.studioHost ?? server?.host ?? process.env.MASTRA_HOST ?? "localhost";
5657
5661
  const port = server?.studioPort ?? server?.port ?? (Number(process.env.PORT) || 4111);
@@ -6084,6 +6088,11 @@ var SlackProvider = class {
6084
6088
  }
6085
6089
  this.#adapters.delete(installation.id);
6086
6090
  this.#slashCommands.delete(installation.webhookId);
6091
+ } else if (record.status === "pending") try {
6092
+ const pending = this.#decryptPendingInstallation(this.#parsePendingInstallation(record));
6093
+ await client.deleteApp(pending.appId);
6094
+ } catch (err) {
6095
+ console.warn(`[Slack] Failed to delete pending Slack app for "${agentId}":`, err);
6087
6096
  }
6088
6097
  await this.#deleteInstallation(record.id);
6089
6098
  }