@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.js CHANGED
@@ -3,7 +3,7 @@ import { createCipheriv, createDecipheriv, createHmac, hkdfSync, timingSafeEqual
3
3
  import { AgentChannels, AgentControllerChannels, resolveWaitUntil } from "@mastra/core/channels";
4
4
  import "@mastra/core/storage";
5
5
  import { createSlackAdapter, createSlackAdapter as createSlackAdapter$1 } from "@chat-adapter/slack";
6
- //#region src/client.ts
6
+ // src/client.ts
7
7
  const SLACK_API_BASE = "https://slack.com/api";
8
8
  const SLACK_API_TIMEOUT_MS = 3e4;
9
9
  /**
@@ -189,8 +189,7 @@ var SlackManifestClient = class {
189
189
  if (!data.ok) console.warn(`[Slack] Failed to set app icon: ${data.error}`);
190
190
  }
191
191
  };
192
- //#endregion
193
- //#region src/crypto.ts
192
+ // src/crypto.ts
194
193
  /**
195
194
  * Verify a Slack request signature.
196
195
  * @see https://api.slack.com/authentication/verifying-requests-from-slack
@@ -249,8 +248,7 @@ function decrypt(ciphertext, key) {
249
248
  decipher.setAuthTag(authTag);
250
249
  return Buffer.concat([decipher.update(encrypted), decipher.final()]).toString("utf8");
251
250
  }
252
- //#endregion
253
- //#region src/manifest.ts
251
+ // src/manifest.ts
254
252
  /**
255
253
  * Default bot scopes required for agent functionality.
256
254
  */
@@ -270,6 +268,7 @@ const DEFAULT_BOT_SCOPES = [
270
268
  "users:read",
271
269
  "reactions:write",
272
270
  "files:read",
271
+ "files:write",
273
272
  "assistant:write"
274
273
  ];
275
274
  /**
@@ -336,8 +335,7 @@ function buildManifest(options) {
336
335
  }));
337
336
  return manifest;
338
337
  }
339
- //#endregion
340
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/util.js
338
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/util.js
341
339
  function getEnumValues(entries) {
342
340
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
343
341
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -864,8 +862,7 @@ function constantCatch(value) {
864
862
  fn[CONSTANT_CATCH] = true;
865
863
  return fn;
866
864
  }
867
- //#endregion
868
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
865
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/core.js
869
866
  var _a$1;
870
867
  const _zodDesc = {
871
868
  value: void 0,
@@ -971,8 +968,7 @@ function config(newConfig) {
971
968
  if (newConfig) Object.assign(globalConfig, newConfig);
972
969
  return globalConfig;
973
970
  }
974
- //#endregion
975
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
971
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/errors.js
976
972
  function _getMessage() {
977
973
  const internals = this._zod;
978
974
  internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
@@ -1086,8 +1082,7 @@ function formatError(error, mapper = (issue) => issue.message) {
1086
1082
  processError(error);
1087
1083
  return fieldErrors;
1088
1084
  }
1089
- //#endregion
1090
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
1085
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/parse.js
1091
1086
  function finalizeParams(callee, params) {
1092
1087
  return {
1093
1088
  callee: params?.callee ?? callee,
@@ -1289,8 +1284,7 @@ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1289
1284
  const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1290
1285
  return _safeParseAsync(_Err)(schema, value, _ctx);
1291
1286
  };
1292
- //#endregion
1293
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
1287
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/regexes.js
1294
1288
  /**
1295
1289
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
1296
1290
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -1358,8 +1352,7 @@ function datetime(args) {
1358
1352
  const anyString = /^[\s\S]{0,}$/;
1359
1353
  const lowercase = /^[^A-Z]*$/;
1360
1354
  const uppercase = /^[^a-z]*$/;
1361
- //#endregion
1362
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
1355
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/checks.js
1363
1356
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
1364
1357
  var _a;
1365
1358
  inst._zod ?? (inst._zod = {});
@@ -1538,8 +1531,7 @@ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (ins
1538
1531
  payload.value = def.tx(payload.value);
1539
1532
  };
1540
1533
  });
1541
- //#endregion
1542
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
1534
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/doc.js
1543
1535
  var Doc = class {
1544
1536
  constructor(args = [], closed = {}) {
1545
1537
  this.content = [];
@@ -1572,15 +1564,13 @@ var Doc = class {
1572
1564
  return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1573
1565
  }
1574
1566
  };
1575
- //#endregion
1576
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
1567
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/versions.js
1577
1568
  const version = {
1578
1569
  major: 4,
1579
1570
  minor: 6,
1580
1571
  patch: 7
1581
1572
  };
1582
- //#endregion
1583
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
1573
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/schemas.js
1584
1574
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1585
1575
  var _a;
1586
1576
  inst ?? (inst = {});
@@ -2776,8 +2766,7 @@ function handleRefineResult(result, payload, input, inst) {
2776
2766
  payload.issues.push(issue(_iss));
2777
2767
  }
2778
2768
  }
2779
- //#endregion
2780
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
2769
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/memoizer.js
2781
2770
  var $ZodCyclicError = class extends Error {
2782
2771
  constructor() {
2783
2772
  super(`Cannot parse a reference cycle that closes through a transform`);
@@ -3029,8 +3018,7 @@ function isBackEdge(ctx, value) {
3029
3018
  const backEdges = ctx[STATE]?.backEdges;
3030
3019
  return backEdges !== void 0 && isRef(value) && backEdges.has(value);
3031
3020
  }
3032
- //#endregion
3033
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
3021
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/locales/en.js
3034
3022
  const error = () => {
3035
3023
  const Sizable = {
3036
3024
  string: {
@@ -3137,8 +3125,7 @@ const error = () => {
3137
3125
  function en_default() {
3138
3126
  return { localeError: error() };
3139
3127
  }
3140
- //#endregion
3141
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
3128
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/registries.js
3142
3129
  var _a;
3143
3130
  var $ZodRegistry = class {
3144
3131
  constructor() {
@@ -3184,8 +3171,7 @@ function registry() {
3184
3171
  }
3185
3172
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
3186
3173
  const globalRegistry = globalThis.__zod_globalRegistry;
3187
- //#endregion
3188
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
3174
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/api.js
3189
3175
  function snapshotChecks(def) {
3190
3176
  if (def.checks) def.checks = [...def.checks];
3191
3177
  return def;
@@ -3624,8 +3610,7 @@ function _check(fn, params) {
3624
3610
  ch._zod.check = fn;
3625
3611
  return ch;
3626
3612
  }
3627
- //#endregion
3628
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
3613
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/to-json-schema.js
3629
3614
  function assignProps(target, ...sources) {
3630
3615
  for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3631
3616
  return target;
@@ -4068,8 +4053,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
4068
4053
  extractDefs(ctx, schema);
4069
4054
  return finalize(ctx, schema);
4070
4055
  };
4071
- //#endregion
4072
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
4056
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/core/json-schema-processors.js
4073
4057
  const narrowMin = (agg, key, value) => {
4074
4058
  if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
4075
4059
  };
@@ -4358,8 +4342,7 @@ const optionalProcessor = (schema, ctx, _json, params) => {
4358
4342
  const seen = ctx.seen.get(schema);
4359
4343
  seen.ref = def.innerType;
4360
4344
  };
4361
- //#endregion
4362
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
4345
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/errors.js
4363
4346
  const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4364
4347
  function _lazyMethod(proto, key, make) {
4365
4348
  Object.defineProperty(proto, key, {
@@ -4408,8 +4391,7 @@ const initializer = (inst, issues) => {
4408
4391
  });
4409
4392
  };
4410
4393
  const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
4411
- //#endregion
4412
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
4394
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/parse.js
4413
4395
  const parse = /* @__PURE__ */ _parse(ZodRealError);
4414
4396
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
4415
4397
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -4422,8 +4404,7 @@ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
4422
4404
  const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
4423
4405
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
4424
4406
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
4425
- //#endregion
4426
- //#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
4407
+ // ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/zod/4.6.7/4c9f15c99caaca8b83ba8ab68f247a75121c86fb7e498876ed36daccd0f3d3ce/node_modules/zod/v4/classic/schemas.js
4427
4408
  function _ensureDefaultLocale() {
4428
4409
  if (!globalConfig.localeError) config(en_default());
4429
4410
  }
@@ -5169,8 +5150,7 @@ function refine(fn, _params = {}) {
5169
5150
  function superRefine(fn, params) {
5170
5151
  return /* @__PURE__ */ _superRefine(fn, params);
5171
5152
  }
5172
- //#endregion
5173
- //#region src/schemas.ts
5153
+ // src/schemas.ts
5174
5154
  /**
5175
5155
  * Zod schemas for Slack channel data stored in ChannelsStorage.
5176
5156
  * These define the shape of the `data` JSON blob in ChannelInstallation records.
@@ -5213,8 +5193,7 @@ const SlackConfigDataSchema = object({
5213
5193
  token: string().optional(),
5214
5194
  refreshToken: string()
5215
5195
  });
5216
- //#endregion
5217
- //#region src/provider.ts
5196
+ // src/provider.ts
5218
5197
  const PLATFORM = "slack";
5219
5198
  /**
5220
5199
  * Remove trailing slashes from a base URL so callback paths like
@@ -5234,13 +5213,14 @@ function stripTrailingSlash(url) {
5234
5213
  * fallback or preserved options.
5235
5214
  */
5236
5215
  function resolveSlackAdapterConfig(channelConfig) {
5237
- const { adapterConfig, cors, gateway, formatError, streaming: topLevelStreaming, textFormat, typingStatus, toolDisplay: topLevelToolDisplay } = channelConfig;
5216
+ const { adapterConfig, cors, gateway, formatError, streaming: topLevelStreaming, textFormat, textDisplay, typingStatus, toolDisplay: topLevelToolDisplay } = channelConfig;
5238
5217
  const filteredTopLevel = Object.fromEntries(Object.entries({
5239
5218
  cors,
5240
5219
  gateway,
5241
5220
  formatError,
5242
5221
  streaming: topLevelStreaming,
5243
5222
  textFormat,
5223
+ textDisplay,
5244
5224
  typingStatus,
5245
5225
  toolDisplay: topLevelToolDisplay
5246
5226
  }).filter(([, value]) => value !== void 0));
@@ -6424,7 +6404,6 @@ var SlackProvider = class {
6424
6404
  }
6425
6405
  }
6426
6406
  };
6427
- //#endregion
6428
6407
  export { DEFAULT_BOT_EVENTS, DEFAULT_BOT_SCOPES, SlackConfigDataSchema, SlackInstallationDataSchema, SlackManifestClient, SlackPendingDataSchema, SlackProvider, buildManifest, createSlackAdapter, parseSlackFormBody, verifySlackRequest };
6429
6408
 
6430
6409
  //# sourceMappingURL=index.js.map