@mastra/slack 1.7.3 → 1.8.0-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
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region \0rolldown/runtime.js
2
+ // \0rolldown/runtime.js
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -20,13 +20,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
20
20
  value: mod,
21
21
  enumerable: true
22
22
  }) : target, mod));
23
- //#endregion
24
23
  let crypto = require("crypto");
25
24
  crypto = __toESM(crypto, 1);
26
25
  let _mastra_core_channels = require("@mastra/core/channels");
27
26
  require("@mastra/core/storage");
28
27
  let _chat_adapter_slack = require("@chat-adapter/slack");
29
- //#region src/client.ts
28
+ // src/client.ts
30
29
  const SLACK_API_BASE = "https://slack.com/api";
31
30
  const SLACK_API_TIMEOUT_MS = 3e4;
32
31
  /**
@@ -212,8 +211,7 @@ var SlackManifestClient = class {
212
211
  if (!data.ok) console.warn(`[Slack] Failed to set app icon: ${data.error}`);
213
212
  }
214
213
  };
215
- //#endregion
216
- //#region src/crypto.ts
214
+ // src/crypto.ts
217
215
  /**
218
216
  * Verify a Slack request signature.
219
217
  * @see https://api.slack.com/authentication/verifying-requests-from-slack
@@ -272,8 +270,7 @@ function decrypt(ciphertext, key) {
272
270
  decipher.setAuthTag(authTag);
273
271
  return Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
274
272
  }
275
- //#endregion
276
- //#region src/manifest.ts
273
+ // src/manifest.ts
277
274
  /**
278
275
  * Default bot scopes required for agent functionality.
279
276
  */
@@ -293,6 +290,7 @@ const DEFAULT_BOT_SCOPES = [
293
290
  "users:read",
294
291
  "reactions:write",
295
292
  "files:read",
293
+ "files:write",
296
294
  "assistant:write"
297
295
  ];
298
296
  /**
@@ -359,8 +357,7 @@ function buildManifest(options) {
359
357
  }));
360
358
  return manifest;
361
359
  }
362
- //#endregion
363
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/util.js
360
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/util.js
364
361
  function getEnumValues(entries) {
365
362
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
366
363
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -887,8 +884,7 @@ function constantCatch(value) {
887
884
  fn[CONSTANT_CATCH] = true;
888
885
  return fn;
889
886
  }
890
- //#endregion
891
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
887
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
892
888
  var _a$1;
893
889
  const _zodDesc = {
894
890
  value: void 0,
@@ -994,8 +990,7 @@ function config(newConfig) {
994
990
  if (newConfig) Object.assign(globalConfig, newConfig);
995
991
  return globalConfig;
996
992
  }
997
- //#endregion
998
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
993
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
999
994
  function _getMessage() {
1000
995
  const internals = this._zod;
1001
996
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -1109,8 +1104,7 @@ function formatError(error, mapper = (issue) => issue.message) {
1109
1104
  processError(error);
1110
1105
  return fieldErrors;
1111
1106
  }
1112
- //#endregion
1113
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
1107
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
1114
1108
  function finalizeParams(callee, params) {
1115
1109
  return {
1116
1110
  callee: params?.callee ?? callee,
@@ -1312,8 +1306,7 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1312
1306
  const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1313
1307
  return _safeParseAsync(_Err)(schema, value, _ctx);
1314
1308
  };
1315
- //#endregion
1316
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
1309
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
1317
1310
  /**
1318
1311
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
1319
1312
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1381,8 +1374,7 @@ function datetime(args) {
1381
1374
  const anyString = /^[\s\S]{0,}$/;
1382
1375
  const lowercase = /^[^A-Z]*$/;
1383
1376
  const uppercase = /^[^a-z]*$/;
1384
- //#endregion
1385
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
1377
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
1386
1378
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1387
1379
  var _a;
1388
1380
  inst._zod ?? (inst._zod = {});
@@ -1561,8 +1553,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1561
1553
  payload.value = def.tx(payload.value);
1562
1554
  };
1563
1555
  });
1564
- //#endregion
1565
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
1556
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
1566
1557
  var Doc = class {
1567
1558
  constructor(args = [], closed = {}) {
1568
1559
  this.content = [];
@@ -1595,15 +1586,13 @@ var Doc = class {
1595
1586
  return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1596
1587
  }
1597
1588
  };
1598
- //#endregion
1599
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
1589
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
1600
1590
  const version = {
1601
1591
  major: 4,
1602
1592
  minor: 6,
1603
1593
  patch: 7
1604
1594
  };
1605
- //#endregion
1606
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
1595
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
1607
1596
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1608
1597
  var _a;
1609
1598
  inst ?? (inst = {});
@@ -2799,8 +2788,7 @@ function handleRefineResult(result, payload, input, inst) {
2799
2788
  payload.issues.push(issue(_iss));
2800
2789
  }
2801
2790
  }
2802
- //#endregion
2803
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
2791
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
2804
2792
  var $ZodCyclicError = class extends Error {
2805
2793
  constructor() {
2806
2794
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3052,8 +3040,7 @@ function isBackEdge(ctx, value) {
3052
3040
  const backEdges = ctx[STATE]?.backEdges;
3053
3041
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3054
3042
  }
3055
- //#endregion
3056
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
3043
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
3057
3044
  const error = () => {
3058
3045
  const Sizable = {
3059
3046
  string: {
@@ -3160,8 +3147,7 @@ const error = () => {
3160
3147
  function en_default() {
3161
3148
  return { localeError: error() };
3162
3149
  }
3163
- //#endregion
3164
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
3150
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
3165
3151
  var _a;
3166
3152
  var $ZodRegistry = class {
3167
3153
  constructor() {
@@ -3207,8 +3193,7 @@ function registry() {
3207
3193
  }
3208
3194
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3209
3195
  const globalRegistry = globalThis.__zod_globalRegistry;
3210
- //#endregion
3211
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
3196
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
3212
3197
  function snapshotChecks(def) {
3213
3198
  if (def.checks) def.checks = [...def.checks];
3214
3199
  return def;
@@ -3647,8 +3632,7 @@ function _check(fn, params) {
3647
3632
  ch._zod.check = fn;
3648
3633
  return ch;
3649
3634
  }
3650
- //#endregion
3651
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
3635
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
3652
3636
  function assignProps(target, ...sources) {
3653
3637
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3654
3638
  return target;
@@ -4091,8 +4075,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
4091
4075
  extractDefs(ctx, schema);
4092
4076
  return finalize(ctx, schema);
4093
4077
  };
4094
- //#endregion
4095
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
4078
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
4096
4079
  const narrowMin = (agg, key, value) => {
4097
4080
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4098
4081
  };
@@ -4381,8 +4364,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
4381
4364
  const seen = ctx.seen.get(schema);
4382
4365
  seen.ref = def.innerType;
4383
4366
  };
4384
- //#endregion
4385
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
4367
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
4386
4368
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4387
4369
  function _lazyMethod(proto, key, make) {
4388
4370
  Object.defineProperty(proto, key, {
@@ -4431,8 +4413,7 @@ const initializer = (inst, issues) => {
4431
4413
  });
4432
4414
  };
4433
4415
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
4434
- //#endregion
4435
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
4416
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
4436
4417
  const parse = /* @__PURE__ */ _parse(ZodRealError);
4437
4418
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
4438
4419
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -4445,8 +4426,7 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
4445
4426
  const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
4446
4427
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
4447
4428
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4448
- //#endregion
4449
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
4429
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
4450
4430
  function _ensureDefaultLocale() {
4451
4431
  if (!globalConfig.localeError) config(en_default());
4452
4432
  }
@@ -5192,8 +5172,7 @@ function refine(fn, _params = {}) {
5192
5172
  function superRefine(fn, params) {
5193
5173
  return /* @__PURE__ */ _superRefine(fn, params);
5194
5174
  }
5195
- //#endregion
5196
- //#region src/schemas.ts
5175
+ // src/schemas.ts
5197
5176
  /**
5198
5177
  * Zod schemas for Slack channel data stored in ChannelsStorage.
5199
5178
  * These define the shape of the `data` JSON blob in ChannelInstallation records.
@@ -5236,8 +5215,7 @@ const SlackConfigDataSchema = object({
5236
5215
  token: string().optional(),
5237
5216
  refreshToken: string()
5238
5217
  });
5239
- //#endregion
5240
- //#region src/provider.ts
5218
+ // src/provider.ts
5241
5219
  const PLATFORM = "slack";
5242
5220
  /**
5243
5221
  * Remove trailing slashes from a base URL so callback paths like
@@ -5257,13 +5235,14 @@ function stripTrailingSlash(url) {
5257
5235
  * fallback or preserved options.
5258
5236
  */
5259
5237
  function resolveSlackAdapterConfig(channelConfig) {
5260
- const { adapterConfig, cors, gateway, formatError, streaming: topLevelStreaming, textFormat, typingStatus, toolDisplay: topLevelToolDisplay } = channelConfig;
5238
+ const { adapterConfig, cors, gateway, formatError, streaming: topLevelStreaming, textFormat, textDisplay, typingStatus, toolDisplay: topLevelToolDisplay } = channelConfig;
5261
5239
  const filteredTopLevel = Object.fromEntries(Object.entries({
5262
5240
  cors,
5263
5241
  gateway,
5264
5242
  formatError,
5265
5243
  streaming: topLevelStreaming,
5266
5244
  textFormat,
5245
+ textDisplay,
5267
5246
  typingStatus,
5268
5247
  toolDisplay: topLevelToolDisplay
5269
5248
  }).filter(([, value]) => value !== void 0));
@@ -6447,7 +6426,6 @@ var SlackProvider = class {
6447
6426
  }
6448
6427
  }
6449
6428
  };
6450
- //#endregion
6451
6429
  exports.DEFAULT_BOT_EVENTS = DEFAULT_BOT_EVENTS;
6452
6430
  exports.DEFAULT_BOT_SCOPES = DEFAULT_BOT_SCOPES;
6453
6431
  exports.SlackConfigDataSchema = SlackConfigDataSchema;