@openclaw/mattermost 2026.7.2-beta.2 → 2026.7.2-beta.4

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.
@@ -35,6 +35,16 @@ function normalizeMattermostBaseUrl(raw) {
35
35
  function buildMattermostApiUrl(baseUrl, path) {
36
36
  const normalized = normalizeMattermostBaseUrl(baseUrl);
37
37
  if (!normalized) throw new Error("Mattermost baseUrl is required");
38
+ const pathname = (path.split(/[?#]/, 1)[0] ?? "").replace(/[\t\r\n]/g, "").replace(/\\/g, "/");
39
+ for (const segment of pathname.split("/")) {
40
+ let decoded;
41
+ try {
42
+ decoded = decodeURIComponent(segment).replace(/[\t\r\n]/g, "");
43
+ } catch {
44
+ throw new Error("Mattermost API path must not contain unsafe path segments");
45
+ }
46
+ if (decoded.split(/[\\/]/).some((part) => part === "." || part === "..")) throw new Error("Mattermost API path must not contain unsafe path segments");
47
+ }
38
48
  return `${normalized}/api/v4${path.startsWith("/") ? path : `/${path}`}`;
39
49
  }
40
50
  async function readMattermostSuccessText(res, path) {
@@ -383,4 +393,4 @@ async function uploadMattermostFile(client, params) {
383
393
  return info;
384
394
  }
385
395
  //#endregion
386
- export { uploadMattermostFile as _, deleteMattermostPost as a, fetchMattermostMe as c, fetchMattermostUserTeams as d, normalizeMattermostBaseUrl as f, updateMattermostPost as g, sendMattermostTyping as h, createMattermostPost as i, fetchMattermostUser as l, resolveMattermostReplyDeliveryBarrierTimeoutMs as m, createMattermostClient as n, fetchMattermostChannel as o, readMattermostError as p, createMattermostDirectChannelWithRetry as r, fetchMattermostChannelByName as s, MattermostPostSchema as t, fetchMattermostUserByUsername as u };
396
+ export { updateMattermostPost as _, createMattermostPost as a, fetchMattermostChannelByName as c, fetchMattermostUserByUsername as d, fetchMattermostUserTeams as f, sendMattermostTyping as g, resolveMattermostReplyDeliveryBarrierTimeoutMs as h, createMattermostDirectChannelWithRetry as i, fetchMattermostMe as l, readMattermostError as m, buildMattermostApiUrl as n, deleteMattermostPost as o, normalizeMattermostBaseUrl as p, createMattermostClient as r, fetchMattermostChannel as s, MattermostPostSchema as t, fetchMattermostUser as u, uploadMattermostFile as v };
@@ -1,6 +1,6 @@
1
1
  import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
2
- import { g as updateMattermostPost } from "./client-BzLj4dyf.js";
3
- import { b as readRequestBodyWithLimit, m as isTrustedProxyAddress, w as resolveClientIp } from "./monitor-auth-dEHa1_On.js";
2
+ import { _ as updateMattermostPost } from "./client-w0lkxuKh.js";
3
+ import { T as resolveClientIp, h as isTrustedProxyAddress, x as readRequestBodyWithLimit } from "./monitor-auth-4zjr5tXP.js";
4
4
  import { createHmac } from "node:crypto";
5
5
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
6
6
  import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -1,6 +1,5 @@
1
1
  import { normalizeLowercaseStringOrEmpty, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
2
2
  import { parseTcpPort } from "openclaw/plugin-sdk/number-runtime";
3
- import { buildAgentMediaPayload } from "openclaw/plugin-sdk/agent-media-payload";
4
3
  import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
5
4
  import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
6
5
  import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
@@ -50,21 +49,24 @@ function formatMattermostDirectMessageDropLog(params) {
50
49
  return `mattermost: drop dm sender=${params.senderId} (dmPolicy=${params.dmPolicy}${reason}${hint})`;
51
50
  }
52
51
  function isMattermostSenderAllowed(params) {
53
- const allowFrom = normalizeMattermostAllowList(params.allowFrom);
54
- if (allowFrom.length === 0) return false;
55
52
  return resolveAllowlistMatchSimple({
56
- allowFrom,
53
+ allowFrom: normalizeMattermostAllowList(params.allowFrom),
57
54
  senderId: normalizeMattermostAllowEntry(params.senderId),
58
55
  senderName: params.senderName ? normalizeMattermostAllowEntry(params.senderName) : void 0,
59
56
  allowNameMatching: params.allowNameMatching
60
57
  }).allowed;
61
58
  }
62
- function mapMattermostChannelKind(channelType) {
59
+ function mapMattermostChannelTypeToChatType(channelType) {
63
60
  const normalized = channelType?.trim().toUpperCase();
61
+ if (!normalized) return "direct";
64
62
  if (normalized === "D") return "direct";
65
63
  if (normalized === "G" || normalized === "P") return "group";
66
64
  return "channel";
67
65
  }
66
+ function resolveMattermostTrustedChatKind(params) {
67
+ const channelType = params.channelType?.trim();
68
+ return channelType ? mapMattermostChannelTypeToChatType(channelType) : params.fallback ?? "direct";
69
+ }
68
70
  async function resolveMattermostMonitorInboundAccess(params) {
69
71
  const { account, cfg, senderId, senderName, channelId, kind, groupPolicy, storeAllowFrom, allowTextCommands, hasControlCommand } = params;
70
72
  const dmPolicy = account.config.dmPolicy ?? "pairing";
@@ -131,7 +133,7 @@ async function authorizeMattermostCommandInvocation(params) {
131
133
  channelDisplay: "",
132
134
  roomLabel: `#${channelId}`
133
135
  };
134
- const kind = mapMattermostChannelKind(channelInfo.type);
136
+ const kind = mapMattermostChannelTypeToChatType(channelInfo.type);
135
137
  const chatType = kind;
136
138
  const channelName = channelInfo.name ?? "";
137
139
  const channelDisplay = channelInfo.display_name ?? channelName;
@@ -180,4 +182,4 @@ async function authorizeMattermostCommandInvocation(params) {
180
182
  };
181
183
  }
182
184
  //#endregion
183
- export { resolveChannelMediaMaxBytes as C, warnMissingProviderGroupPolicyFallbackOnce as E, resolveAllowlistProviderRuntimeGroupPolicy as S, resolveDefaultGroupPolicy as T, logInboundDrop as _, normalizeMattermostAllowList as a, readRequestBodyWithLimit as b, buildAgentMediaPayload as c, createChannelMessageReplyPipeline as d, createChannelPairingController as f, loadOutboundMediaFromUrl as g, listSkillCommandsForAgents as h, normalizeMattermostAllowEntry as i, buildModelsProviderData as l, isTrustedProxyAddress as m, formatMattermostDirectMessageDropLog as n, resolveMattermostMonitorInboundAccess as o, isRequestBodyLimitError as p, isMattermostSenderAllowed as r, DEFAULT_GROUP_HISTORY_LIMIT as s, authorizeMattermostCommandInvocation as t, createChannelHistoryWindow as u, logTypingFailure as v, resolveClientIp as w, registerPluginHttpRoute as x, parseTcpPort as y };
185
+ export { resolveAllowlistProviderRuntimeGroupPolicy as C, warnMissingProviderGroupPolicyFallbackOnce as D, resolveDefaultGroupPolicy as E, registerPluginHttpRoute as S, resolveClientIp as T, loadOutboundMediaFromUrl as _, normalizeMattermostAllowEntry as a, parseTcpPort as b, resolveMattermostTrustedChatKind as c, createChannelHistoryWindow as d, createChannelMessageReplyPipeline as f, listSkillCommandsForAgents as g, isTrustedProxyAddress as h, mapMattermostChannelTypeToChatType as i, DEFAULT_GROUP_HISTORY_LIMIT as l, isRequestBodyLimitError as m, formatMattermostDirectMessageDropLog as n, normalizeMattermostAllowList as o, createChannelPairingController as p, isMattermostSenderAllowed as r, resolveMattermostMonitorInboundAccess as s, authorizeMattermostCommandInvocation as t, buildModelsProviderData as u, logInboundDrop as v, resolveChannelMediaMaxBytes as w, readRequestBodyWithLimit as x, logTypingFailure as y };
@@ -1,2 +1,2 @@
1
- import { r as isMattermostSenderAllowed } from "./monitor-auth-dEHa1_On.js";
1
+ import { r as isMattermostSenderAllowed } from "./monitor-auth-4zjr5tXP.js";
2
2
  export { isMattermostSenderAllowed };
@@ -1,5 +1,4 @@
1
1
  import { r as setMattermostRuntime } from "./runtime-CNB4YGqJ.js";
2
- import { buildAgentMediaPayload } from "openclaw/plugin-sdk/agent-media-payload";
3
2
  import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
4
3
  import { formatInboundFromLabel, logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
5
4
  import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
@@ -18,6 +17,7 @@ import { DEFAULT_ACCOUNT_ID, buildChannelConfigSchema, createDedupeCache, isTrus
18
17
  import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
19
18
  import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, migrateBaseNameToDefaultAccount } from "openclaw/plugin-sdk/setup";
20
19
  import { buildComputedAccountStatusSnapshot } from "openclaw/plugin-sdk/channel-status";
20
+ import { buildAgentMediaPayload } from "openclaw/plugin-sdk/agent-media-payload";
21
21
  import { resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
22
22
  import { normalizeAccountId, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
23
23
  import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
@@ -1,2 +1,2 @@
1
- import { i as registerSlashCommandRoute } from "./slash-state-C9bpBN40.js";
1
+ import { i as registerSlashCommandRoute } from "./slash-state-CFEaCLnp.js";
2
2
  export { registerSlashCommandRoute };
@@ -1,8 +1,8 @@
1
1
  import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
2
- import { _ as uploadMattermostFile, c as fetchMattermostMe, d as fetchMattermostUserTeams, f as normalizeMattermostBaseUrl, h as sendMattermostTyping, i as createMattermostPost, l as fetchMattermostUser, m as resolveMattermostReplyDeliveryBarrierTimeoutMs, n as createMattermostClient, o as fetchMattermostChannel, r as createMattermostDirectChannelWithRetry, s as fetchMattermostChannelByName, u as fetchMattermostUserByUsername } from "./client-BzLj4dyf.js";
3
- import { a as normalizeMattermostAllowList, b as readRequestBodyWithLimit, d as createChannelMessageReplyPipeline, g as loadOutboundMediaFromUrl, l as buildModelsProviderData, p as isRequestBodyLimitError, t as authorizeMattermostCommandInvocation, v as logTypingFailure } from "./monitor-auth-dEHa1_On.js";
4
- import { c as setInteractionSecret, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-DO7J-ND1.js";
5
- import { r as resolveMattermostAccount } from "./accounts-C4Azn6rA.js";
2
+ import { a as createMattermostPost, c as fetchMattermostChannelByName, d as fetchMattermostUserByUsername, f as fetchMattermostUserTeams, g as sendMattermostTyping, h as resolveMattermostReplyDeliveryBarrierTimeoutMs, i as createMattermostDirectChannelWithRetry, l as fetchMattermostMe, p as normalizeMattermostBaseUrl, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostUser, v as uploadMattermostFile } from "./client-w0lkxuKh.js";
3
+ import { _ as loadOutboundMediaFromUrl, f as createChannelMessageReplyPipeline, m as isRequestBodyLimitError, o as normalizeMattermostAllowList, t as authorizeMattermostCommandInvocation, u as buildModelsProviderData, x as readRequestBodyWithLimit, y as logTypingFailure } from "./monitor-auth-4zjr5tXP.js";
4
+ import { c as setInteractionSecret, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-DODXaHdE.js";
5
+ import { r as resolveMattermostAccount } from "./accounts-B-GrNVwP.js";
6
6
  import { createHash } from "node:crypto";
7
7
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -16,6 +16,8 @@ import { convertMarkdownTables } from "openclaw/plugin-sdk/text-chunking";
16
16
  import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
17
17
  import { normalizeProviderId } from "openclaw/plugin-sdk/provider-model-shared";
18
18
  import { Readable } from "node:stream";
19
+ import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
20
+ import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-runtime";
19
21
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
20
22
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
21
23
  import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
@@ -825,6 +827,35 @@ async function resolveMattermostOpaqueTarget(params) {
825
827
  //#region extensions/mattermost/src/mattermost/send.ts
826
828
  const MATTERMOST_BOT_USER_CACHE_MAX_ENTRIES = 64;
827
829
  const MATTERMOST_TARGET_CACHE_MAX_ENTRIES = 1024;
830
+ const MATTERMOST_FORMAT_PROFILE = {
831
+ mechanism: "markdown",
832
+ constructs: {
833
+ bold: "native",
834
+ italic: "native",
835
+ underline: "native",
836
+ strikethrough: "native",
837
+ spoiler: "native",
838
+ codeInline: "native",
839
+ codeBlock: "native",
840
+ codeLanguage: "native",
841
+ linkLabel: "native",
842
+ heading: "native",
843
+ bulletList: "native",
844
+ orderedList: "native",
845
+ taskList: "native",
846
+ table: "native",
847
+ blockquote: "native",
848
+ image: "native",
849
+ mention: "native"
850
+ },
851
+ chunk: {
852
+ limit: 16383,
853
+ unit: "chars"
854
+ }
855
+ };
856
+ function renderMattermostMarkdown(markdown, tableMode) {
857
+ return tableMode === "off" && MATTERMOST_FORMAT_PROFILE.constructs.table === "native" ? markdown : convertMarkdownTables(markdown, tableMode);
858
+ }
828
859
  const botUserCache = /* @__PURE__ */ new Map();
829
860
  const userByNameCache = /* @__PURE__ */ new Map();
830
861
  const channelByNameCache = /* @__PURE__ */ new Map();
@@ -1067,7 +1098,7 @@ async function sendMessageMattermost(to, text, opts) {
1067
1098
  channel: "mattermost",
1068
1099
  accountId
1069
1100
  });
1070
- message = convertMarkdownTables(message, tableMode);
1101
+ message = renderMattermostMarkdown(message, tableMode);
1071
1102
  }
1072
1103
  if (!message && (!fileIds || fileIds.length === 0)) {
1073
1104
  if (uploadError) throw new Error(`Mattermost media upload failed: ${uploadError.message}`, { cause: uploadError });
@@ -1587,7 +1618,7 @@ async function handleSlashCommandAsync(params) {
1587
1618
  runtime.log?.(`delivered model picker to ${to}`);
1588
1619
  return;
1589
1620
  }
1590
- const ctxPayload = core.channel.reply.finalizeInboundContext({
1621
+ const ctxPayload = finalizeInboundContext({
1591
1622
  Body: commandText,
1592
1623
  BodyForAgent: commandText,
1593
1624
  RawBody: commandText,
@@ -1634,51 +1665,43 @@ async function handleSlashCommandAsync(params) {
1634
1665
  }
1635
1666
  }
1636
1667
  });
1637
- const humanDelay = core.channel.reply.resolveHumanDelayConfig(cfg, route.agentId);
1668
+ const humanDelay = resolveHumanDelayConfig(cfg, route.agentId);
1638
1669
  const deliveryBarrier = createMattermostReplyDeliveryBarrier({
1639
1670
  isDirect: kind === "direct",
1640
1671
  dmRetryOptions: account.config.dmChannelRetry
1641
1672
  });
1642
- const { dispatcher, replyOptions, markDispatchIdle } = core.channel.reply.createReplyDispatcherWithTyping({
1643
- ...replyPipeline,
1644
- resolveFollowupAdmissionBarrierTimeoutPolicy: deliveryBarrier.resolveTimeoutPolicy,
1645
- onDeliverySettled: deliveryBarrier.markDeliverySettled,
1646
- humanDelay,
1647
- deliver: async (payload) => {
1648
- await deliverMattermostReplyPayload({
1649
- core,
1650
- cfg,
1651
- payload,
1652
- to,
1653
- accountId: account.accountId,
1654
- agentId: route.agentId,
1655
- textLimit,
1656
- tableMode,
1657
- sendMessage: sendMessageMattermost,
1658
- onDmChannelResolution: deliveryBarrier.trackDmChannelResolution
1659
- });
1660
- runtime.log?.(`delivered slash reply to ${to}`);
1661
- },
1662
- onError: (err, info) => {
1663
- runtime.error?.(`mattermost slash ${info.kind} reply failed: ${sanitizeCommandLookupError(err)}`);
1664
- },
1665
- onReplyStart: typingCallbacks?.onReplyStart
1666
- });
1667
- await core.channel.reply.withReplyDispatcher({
1668
- dispatcher,
1669
- onSettled: () => {
1670
- markDispatchIdle();
1673
+ await core.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
1674
+ ctx: ctxPayload,
1675
+ cfg,
1676
+ dispatcherOptions: {
1677
+ ...replyPipeline,
1678
+ resolveFollowupAdmissionBarrierTimeoutPolicy: deliveryBarrier.resolveTimeoutPolicy,
1679
+ onDeliverySettled: deliveryBarrier.markDeliverySettled,
1680
+ humanDelay,
1681
+ deliver: async (payload) => {
1682
+ await deliverMattermostReplyPayload({
1683
+ core,
1684
+ cfg,
1685
+ payload,
1686
+ to,
1687
+ accountId: account.accountId,
1688
+ agentId: route.agentId,
1689
+ textLimit,
1690
+ tableMode,
1691
+ sendMessage: sendMessageMattermost,
1692
+ onDmChannelResolution: deliveryBarrier.trackDmChannelResolution
1693
+ });
1694
+ runtime.log?.(`delivered slash reply to ${to}`);
1695
+ },
1696
+ onError: (err, info) => {
1697
+ runtime.error?.(`mattermost slash ${info.kind} reply failed: ${sanitizeCommandLookupError(err)}`);
1698
+ },
1699
+ typingCallbacks
1671
1700
  },
1672
- run: () => core.channel.reply.dispatchReplyFromConfig({
1673
- ctx: ctxPayload,
1674
- cfg,
1675
- dispatcher,
1676
- replyOptions: {
1677
- ...replyOptions,
1678
- disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
1679
- onModelSelected
1680
- }
1681
- })
1701
+ replyOptions: {
1702
+ disableBlockStreaming: typeof account.blockStreaming === "boolean" ? !account.blockStreaming : void 0,
1703
+ onModelSelected
1704
+ }
1682
1705
  });
1683
1706
  }
1684
1707
  //#endregion
@@ -77,6 +77,7 @@ class Receiver extends Writable {
77
77
 
78
78
  this._totalPayloadLength = 0;
79
79
  this._messageLength = 0;
80
+ this._numFragments = 0;
80
81
  this._fragments = [];
81
82
 
82
83
  this._errored = false;
@@ -500,6 +501,19 @@ class Receiver extends Writable {
500
501
  return;
501
502
  }
502
503
 
504
+ if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
505
+ const error = this.createError(
506
+ RangeError,
507
+ 'Too many message fragments',
508
+ false,
509
+ 1008,
510
+ 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
511
+ );
512
+
513
+ cb(error);
514
+ return;
515
+ }
516
+
503
517
  if (this._compressed) {
504
518
  this._state = INFLATING;
505
519
  this.decompress(data, cb);
@@ -507,22 +521,6 @@ class Receiver extends Writable {
507
521
  }
508
522
 
509
523
  if (data.length) {
510
- if (
511
- this._maxFragments > 0 &&
512
- this._fragments.length >= this._maxFragments
513
- ) {
514
- const error = this.createError(
515
- RangeError,
516
- 'Too many message fragments',
517
- false,
518
- 1008,
519
- 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
520
- );
521
-
522
- cb(error);
523
- return;
524
- }
525
-
526
524
  //
527
525
  // This message is not compressed so its length is the sum of the payload
528
526
  // length of all fragments.
@@ -562,22 +560,6 @@ class Receiver extends Writable {
562
560
  return;
563
561
  }
564
562
 
565
- if (
566
- this._maxFragments > 0 &&
567
- this._fragments.length >= this._maxFragments
568
- ) {
569
- const error = this.createError(
570
- RangeError,
571
- 'Too many message fragments',
572
- false,
573
- 1008,
574
- 'WS_ERR_TOO_MANY_BUFFERED_PARTS'
575
- );
576
-
577
- cb(error);
578
- return;
579
- }
580
-
581
563
  this._fragments.push(buf);
582
564
  }
583
565
 
@@ -604,6 +586,7 @@ class Receiver extends Writable {
604
586
  this._totalPayloadLength = 0;
605
587
  this._messageLength = 0;
606
588
  this._fragmented = 0;
589
+ this._numFragments = 0;
607
590
  this._fragments = [];
608
591
 
609
592
  if (this._opcode === 2) {
@@ -43,9 +43,9 @@ class WebSocketServer extends EventEmitter {
43
43
  * called
44
44
  * @param {Function} [options.handleProtocols] A hook to handle protocols
45
45
  * @param {String} [options.host] The hostname where to bind the server
46
- * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
46
+ * @param {Number} [options.maxBufferedChunks=262144] The maximum number of
47
47
  * buffered data chunks
48
- * @param {Number} [options.maxFragments=131072] The maximum number of message
48
+ * @param {Number} [options.maxFragments=16384] The maximum number of message
49
49
  * fragments
50
50
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
51
51
  * size
@@ -69,8 +69,8 @@ class WebSocketServer extends EventEmitter {
69
69
  options = {
70
70
  allowSynchronousEvents: true,
71
71
  autoPong: true,
72
- maxBufferedChunks: 1024 * 1024,
73
- maxFragments: 128 * 1024,
72
+ maxBufferedChunks: 256 * 1024,
73
+ maxFragments: 16 * 1024,
74
74
  maxPayload: 100 * 1024 * 1024,
75
75
  skipUTF8Validation: false,
76
76
  perMessageDeflate: false,
@@ -646,9 +646,9 @@ module.exports = WebSocket;
646
646
  * masking key
647
647
  * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the
648
648
  * handshake request
649
- * @param {Number} [options.maxBufferedChunks=1048576] The maximum number of
649
+ * @param {Number} [options.maxBufferedChunks=262144] The maximum number of
650
650
  * buffered data chunks
651
- * @param {Number} [options.maxFragments=131072] The maximum number of message
651
+ * @param {Number} [options.maxFragments=16384] The maximum number of message
652
652
  * fragments
653
653
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
654
654
  * size
@@ -670,8 +670,8 @@ function initAsClient(websocket, address, protocols, options) {
670
670
  autoPong: true,
671
671
  closeTimeout: CLOSE_TIMEOUT,
672
672
  protocolVersion: protocolVersions[1],
673
- maxBufferedChunks: 1024 * 1024,
674
- maxFragments: 128 * 1024,
673
+ maxBufferedChunks: 256 * 1024,
674
+ maxFragments: 16 * 1024,
675
675
  maxPayload: 100 * 1024 * 1024,
676
676
  skipUTF8Validation: false,
677
677
  perMessageDeflate: true,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ws",
3
- "version": "8.21.0",
3
+ "version": "8.21.1",
4
4
  "description": "Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js",
5
5
  "keywords": [
6
6
  "HyBi",
@@ -66,5 +66,9 @@
66
66
  "nyc": "^15.0.0",
67
67
  "prettier": "^3.0.0",
68
68
  "utf-8-validate": "^6.0.0"
69
+ },
70
+ "allowScripts": {
71
+ "bufferutil": true,
72
+ "utf-8-validate": true
69
73
  }
70
74
  }
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@openclaw/mattermost",
3
- "version": "2026.7.2-beta.2",
3
+ "version": "2026.7.2-beta.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/mattermost",
9
- "version": "2026.7.2-beta.2",
9
+ "version": "2026.7.2-beta.4",
10
10
  "dependencies": {
11
- "ws": "8.21.0",
11
+ "ws": "8.21.1",
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.7.2-beta.2"
15
+ "openclaw": ">=2026.7.2-beta.4"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -21,9 +21,9 @@
21
21
  }
22
22
  },
23
23
  "node_modules/ws": {
24
- "version": "8.21.0",
25
- "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
26
- "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
24
+ "version": "8.21.1",
25
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.1.tgz",
26
+ "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==",
27
27
  "license": "MIT",
28
28
  "engines": {
29
29
  "node": ">=10.0.0"
@@ -7,12 +7,6 @@
7
7
  "channels": [
8
8
  "mattermost"
9
9
  ],
10
- "channelEnvVars": {
11
- "mattermost": [
12
- "MATTERMOST_BOT_TOKEN",
13
- "MATTERMOST_URL"
14
- ]
15
- },
16
10
  "configSchema": {
17
11
  "type": "object",
18
12
  "additionalProperties": false,
@@ -155,6 +149,21 @@
155
149
  "requireMention": {
156
150
  "type": "boolean"
157
151
  },
152
+ "implicitMentions": {
153
+ "type": "object",
154
+ "properties": {
155
+ "replyToBot": {
156
+ "type": "boolean"
157
+ },
158
+ "quotedBot": {
159
+ "type": "boolean"
160
+ },
161
+ "threadParticipation": {
162
+ "type": "boolean"
163
+ }
164
+ },
165
+ "additionalProperties": false
166
+ },
158
167
  "dmPolicy": {
159
168
  "default": "pairing",
160
169
  "type": "string",
@@ -608,6 +617,21 @@
608
617
  "requireMention": {
609
618
  "type": "boolean"
610
619
  },
620
+ "implicitMentions": {
621
+ "type": "object",
622
+ "properties": {
623
+ "replyToBot": {
624
+ "type": "boolean"
625
+ },
626
+ "quotedBot": {
627
+ "type": "boolean"
628
+ },
629
+ "threadParticipation": {
630
+ "type": "boolean"
631
+ }
632
+ },
633
+ "additionalProperties": false
634
+ },
611
635
  "dmPolicy": {
612
636
  "default": "pairing",
613
637
  "type": "string",
@@ -951,6 +975,22 @@
951
975
  "label": "Mattermost DM Policy",
952
976
  "help": "Direct message access control (\"pairing\" recommended). \"open\" requires channels.mattermost.allowFrom=[\"*\"]."
953
977
  },
978
+ "implicitMentions": {
979
+ "label": "Mattermost Implicit Mentions",
980
+ "help": "Control which Mattermost reply, quote, and thread-participation signals count as mentions. Unset flags preserve the channel defaults."
981
+ },
982
+ "implicitMentions.replyToBot": {
983
+ "label": "Mattermost Replies to Bot",
984
+ "help": "Treat replies to the bot's own messages as implicit mentions when the channel reports that signal."
985
+ },
986
+ "implicitMentions.quotedBot": {
987
+ "label": "Mattermost Quoted Bot Messages",
988
+ "help": "Treat messages quoting the bot as implicit mentions when the channel reports that signal."
989
+ },
990
+ "implicitMentions.threadParticipation": {
991
+ "label": "Mattermost Thread Participation",
992
+ "help": "Treat follow-ups in threads where the bot participated as implicit mentions when the channel reports that signal."
993
+ },
954
994
  "streaming": {
955
995
  "label": "Mattermost Streaming Mode",
956
996
  "help": "Unified Mattermost stream preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". \"progress\" keeps a single editable progress draft until final delivery."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/mattermost",
3
- "version": "2026.7.2-beta.2",
3
+ "version": "2026.7.2-beta.4",
4
4
  "description": "OpenClaw Mattermost channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,11 +8,11 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "ws": "8.21.0",
11
+ "ws": "8.21.1",
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.7.2-beta.2"
15
+ "openclaw": ">=2026.7.2-beta.4"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -26,12 +26,58 @@
26
26
  "setupEntry": "./dist/setup-entry.js",
27
27
  "channel": {
28
28
  "id": "mattermost",
29
+ "configuredState": {
30
+ "env": {
31
+ "allOf": [
32
+ "MATTERMOST_BOT_TOKEN",
33
+ "MATTERMOST_URL"
34
+ ]
35
+ }
36
+ },
29
37
  "label": "Mattermost",
30
38
  "selectionLabel": "Mattermost (plugin)",
31
39
  "docsPath": "/channels/mattermost",
32
40
  "docsLabel": "mattermost",
33
41
  "blurb": "self-hosted Slack-style chat; install the plugin to enable.",
34
- "order": 65
42
+ "order": 65,
43
+ "setup": {
44
+ "fields": [
45
+ {
46
+ "key": "token",
47
+ "kind": "string",
48
+ "sensitive": true,
49
+ "cli": {
50
+ "flags": "--token <token>",
51
+ "description": "Mattermost bot token"
52
+ }
53
+ },
54
+ {
55
+ "key": "botToken",
56
+ "kind": "string",
57
+ "sensitive": true,
58
+ "cli": {
59
+ "flags": "--bot-token <token>",
60
+ "description": "Mattermost bot token"
61
+ }
62
+ },
63
+ {
64
+ "key": "httpUrl",
65
+ "kind": "string",
66
+ "cli": {
67
+ "flags": "--http-url <url>",
68
+ "description": "Mattermost server URL"
69
+ }
70
+ },
71
+ {
72
+ "key": "useEnv",
73
+ "kind": "boolean",
74
+ "cli": {
75
+ "flags": "--use-env",
76
+ "description": "Use Mattermost environment credentials"
77
+ }
78
+ }
79
+ ]
80
+ }
35
81
  },
36
82
  "install": {
37
83
  "clawhubSpec": "clawhub:@openclaw/mattermost",
@@ -41,10 +87,10 @@
41
87
  "allowInvalidConfigRecovery": true
42
88
  },
43
89
  "compat": {
44
- "pluginApi": ">=2026.7.2-beta.2"
90
+ "pluginApi": ">=2026.7.2-beta.4"
45
91
  },
46
92
  "build": {
47
- "openclawVersion": "2026.7.2-beta.2",
93
+ "openclawVersion": "2026.7.2-beta.4",
48
94
  "bundledDist": false
49
95
  },
50
96
  "release": {