@mastra/slack 1.6.0 → 1.6.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/CHANGELOG.md +16 -0
- package/dist/index.cjs +32 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -27
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @mastra/slack
|
|
2
2
|
|
|
3
|
+
## 1.6.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `SlackProvider` now accepts the `textFormat` option and passes it through to the Slack adapter config, so provider users can set `textFormat: 'plain'` to post agent replies as literal plain text instead of the new markdown default. When unset, the option is omitted and the core markdown default applies. ([#20971](https://github.com/mastra-ai/mastra/pull/20971))
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
const slack = new SlackProvider({
|
|
11
|
+
refreshToken: process.env.SLACK_APP_CONFIG_REFRESH_TOKEN,
|
|
12
|
+
textFormat: 'plain',
|
|
13
|
+
});
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`76e5132`](https://github.com/mastra-ai/mastra/commit/76e51328dbc0749c8304e6b3f21e4401f451b081), [`0282e16`](https://github.com/mastra-ai/mastra/commit/0282e16115538c8e9b248b90f0748eb01cb5dc98)]:
|
|
17
|
+
- @mastra/core@1.58.0-alpha.4
|
|
18
|
+
|
|
3
19
|
## 1.6.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -4028,6 +4028,36 @@ function stripTrailingSlash(url) {
|
|
|
4028
4028
|
return end === url.length ? url : url.slice(0, end);
|
|
4029
4029
|
}
|
|
4030
4030
|
/**
|
|
4031
|
+
* Resolve the per-adapter config applied to the Slack entry in
|
|
4032
|
+
* `AgentChannels.adapters`. Top-level fields on `SlackProviderConfig` win;
|
|
4033
|
+
* the deprecated `adapterConfig` is merged in as a fallback for backwards
|
|
4034
|
+
* compatibility. Undefined values are filtered so they don't clobber the
|
|
4035
|
+
* fallback or preserved options.
|
|
4036
|
+
*/
|
|
4037
|
+
function resolveSlackAdapterConfig(channelConfig) {
|
|
4038
|
+
const { adapterConfig, cors, gateway, formatError, streaming: topLevelStreaming, textFormat, typingStatus, toolDisplay: topLevelToolDisplay } = channelConfig;
|
|
4039
|
+
const filteredTopLevel = Object.fromEntries(Object.entries({
|
|
4040
|
+
cors,
|
|
4041
|
+
gateway,
|
|
4042
|
+
formatError,
|
|
4043
|
+
streaming: topLevelStreaming,
|
|
4044
|
+
textFormat,
|
|
4045
|
+
typingStatus,
|
|
4046
|
+
toolDisplay: topLevelToolDisplay
|
|
4047
|
+
}).filter(([, value]) => value !== void 0));
|
|
4048
|
+
const merged = {
|
|
4049
|
+
...Object.fromEntries(Object.entries(adapterConfig ?? {}).filter(([, value]) => value !== void 0)),
|
|
4050
|
+
...filteredTopLevel
|
|
4051
|
+
};
|
|
4052
|
+
const streaming = merged.streaming ?? true;
|
|
4053
|
+
const toolDisplay = merged.toolDisplay ?? (streaming ? "grouped" : "cards");
|
|
4054
|
+
return {
|
|
4055
|
+
...merged,
|
|
4056
|
+
streaming,
|
|
4057
|
+
toolDisplay
|
|
4058
|
+
};
|
|
4059
|
+
}
|
|
4060
|
+
/**
|
|
4031
4061
|
* Create a hash of the agent config for change detection.
|
|
4032
4062
|
* Uses the resolved app name (config.name ?? agentName) to detect renames.
|
|
4033
4063
|
*/
|
|
@@ -4583,34 +4613,9 @@ var SlackProvider = class {
|
|
|
4583
4613
|
chatOptions
|
|
4584
4614
|
}).filter(([, value]) => value !== void 0));
|
|
4585
4615
|
}
|
|
4586
|
-
/**
|
|
4587
|
-
* Resolve the per-adapter config applied to the Slack entry in
|
|
4588
|
-
* `AgentChannels.adapters`. Top-level fields on `SlackProviderConfig` win;
|
|
4589
|
-
* the deprecated `adapterConfig` is merged in as a fallback for backwards
|
|
4590
|
-
* compatibility. Undefined values are filtered so they don't clobber the
|
|
4591
|
-
* fallback or preserved options.
|
|
4592
|
-
*/
|
|
4616
|
+
/** See {@link resolveSlackAdapterConfig}. */
|
|
4593
4617
|
#resolveSlackAdapterConfig() {
|
|
4594
|
-
|
|
4595
|
-
const filteredTopLevel = Object.fromEntries(Object.entries({
|
|
4596
|
-
cors,
|
|
4597
|
-
gateway,
|
|
4598
|
-
formatError,
|
|
4599
|
-
streaming: topLevelStreaming,
|
|
4600
|
-
typingStatus,
|
|
4601
|
-
toolDisplay: topLevelToolDisplay
|
|
4602
|
-
}).filter(([, value]) => value !== void 0));
|
|
4603
|
-
const merged = {
|
|
4604
|
-
...Object.fromEntries(Object.entries(adapterConfig ?? {}).filter(([, value]) => value !== void 0)),
|
|
4605
|
-
...filteredTopLevel
|
|
4606
|
-
};
|
|
4607
|
-
const streaming = merged.streaming ?? true;
|
|
4608
|
-
const toolDisplay = merged.toolDisplay ?? (streaming ? "grouped" : "cards");
|
|
4609
|
-
return {
|
|
4610
|
-
...merged,
|
|
4611
|
-
streaming,
|
|
4612
|
-
toolDisplay
|
|
4613
|
-
};
|
|
4618
|
+
return resolveSlackAdapterConfig(this.#channelConfig);
|
|
4614
4619
|
}
|
|
4615
4620
|
/**
|
|
4616
4621
|
* Create AgentChannels for an agent with the Slack adapter.
|