@openclaw/mattermost 2026.9.1 → 2026.9.2

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.
@@ -1,5 +1,5 @@
1
1
  import { o as isMattermostConfigured } from "./normalize-R-ATEEHC.js";
2
- import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta, t as mattermostPlugin } from "./channel-plugin-runtime-C6tfh14W.js";
2
+ import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta, t as mattermostPlugin } from "./channel-plugin-runtime-Bq86sS1N.js";
3
3
  import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
4
4
  //#region extensions/mattermost/src/channel.setup.ts
5
5
  const mattermostSetupPlugin = {
@@ -19,6 +19,7 @@ const mattermostSetupPlugin = {
19
19
  },
20
20
  reload: {
21
21
  configPrefixes: ["channels.mattermost"],
22
+ noopPrefixes: ["messages.inbound"],
22
23
  /**
23
24
  * accounts.default is promoted; named resolution merges only channel-wide fields
24
25
  * plus the selected account. Runtime monitor, debounce, and ingress use accountId.
@@ -594,7 +594,7 @@ const mattermostSetupWizard = {
594
594
  };
595
595
  //#endregion
596
596
  //#region extensions/mattermost/src/channel.ts
597
- const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CdT1mcEl.js"));
597
+ const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-B454n78J.js"));
598
598
  const MATTERMOST_PRESENTATION_CAPABILITIES = {
599
599
  supported: true,
600
600
  buttons: true,
@@ -1031,6 +1031,7 @@ const mattermostPlugin = createChatChannelPlugin({
1031
1031
  } },
1032
1032
  reload: {
1033
1033
  configPrefixes: ["channels.mattermost"],
1034
+ noopPrefixes: ["messages.inbound"],
1034
1035
  /**
1035
1036
  * accounts.default is promoted; named resolution merges only channel-wide fields
1036
1037
  * plus the selected account. Monitor debounce and durable ingress use accountId.
@@ -1,2 +1,2 @@
1
- import { t as mattermostPlugin } from "./channel-plugin-runtime-C6tfh14W.js";
1
+ import { t as mattermostPlugin } from "./channel-plugin-runtime-Bq86sS1N.js";
2
2
  export { mattermostPlugin };
@@ -21,6 +21,7 @@ import { resolveAllowlistProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/
21
21
  import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
22
22
  import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
23
23
  import { fanInChannelIngressLifecycles, resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
24
+ import { resolveChannelGroups, resolveChannelGroupsConfigPath } from "openclaw/plugin-sdk/channel-policy";
24
25
  import { buildTtsSupplementMediaPayload, countOutboundMedia, getReplyPayloadTtsSupplement, isReasoningReplyPayload, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
25
26
  import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
26
27
  import { isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
@@ -30,6 +31,7 @@ import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
30
31
  import { finalizeInboundContext } from "openclaw/plugin-sdk/reply-runtime";
31
32
  import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
32
33
  import { channelReadyPatch, isLoopbackHost } from "openclaw/plugin-sdk/gateway-runtime";
34
+ import { createRuntimeConfigReader } from "openclaw/plugin-sdk/runtime-config-snapshot";
33
35
  import { captureWsEvent, createDebugProxyWebSocketAgent, resolveDebugProxySettings } from "openclaw/plugin-sdk/proxy-capture";
34
36
  import WebSocket from "ws";
35
37
  import { resolveChannelContextVisibilityMode, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/context-visibility-runtime";
@@ -686,7 +688,7 @@ function formatMattermostNoVisibleReplyLog(params) {
686
688
  //#endregion
687
689
  //#region extensions/mattermost/src/mattermost/monitor-context.ts
688
690
  function shouldUpdateMattermostDraftToolProgress(account) {
689
- return account.streamingMode !== "off" && resolveChannelStreamingPreviewToolProgress(account.config, true, account.streamingMode);
691
+ return account.streamingMode !== "off" && resolveChannelStreamingPreviewToolProgress(account.config, account.streamingMode !== "progress", account.streamingMode);
690
692
  }
691
693
  function shouldSuppressMattermostDefaultToolProgressMessages(account) {
692
694
  return account.streamingMode !== "off";
@@ -1345,7 +1347,6 @@ function createMattermostMonitorResources(params) {
1345
1347
  return info;
1346
1348
  } catch (err) {
1347
1349
  logger.debug?.(`mattermost: channel lookup failed: ${String(err)}`);
1348
- setCachedValue(channelCache, channelId, null, CHANNEL_CACHE_TTL_MS, rawNow);
1349
1350
  return null;
1350
1351
  }
1351
1352
  };
@@ -1359,7 +1360,6 @@ function createMattermostMonitorResources(params) {
1359
1360
  return info;
1360
1361
  } catch (err) {
1361
1362
  logger.debug?.(`mattermost: user lookup failed: ${String(err)}`);
1362
- setCachedValue(userCache, userId, null, USER_CACHE_TTL_MS, rawNow);
1363
1363
  return null;
1364
1364
  }
1365
1365
  };
@@ -1907,7 +1907,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
1907
1907
  });
1908
1908
  const hookRunner = getGlobalHookRunner();
1909
1909
  const draftPreviewEnabled = !((hookRunner?.hasHooks("reply_payload_sending") ?? false) || (hookRunner?.hasHooks("message_sending") ?? false)) && account.streamingMode !== "off";
1910
- const draftToolProgressEnabled = draftPreviewEnabled && shouldUpdateMattermostDraftToolProgress(account);
1910
+ const draftProgressEnabled = draftPreviewEnabled && (account.streamingMode === "progress" || shouldUpdateMattermostDraftToolProgress(account));
1911
1911
  const suppressDefaultToolProgressMessages = draftPreviewEnabled && shouldSuppressMattermostDefaultToolProgressMessages(account);
1912
1912
  const draftStream = draftPreviewEnabled ? createMattermostDraftStream({
1913
1913
  client,
@@ -2155,9 +2155,9 @@ async function dispatchMattermostInboundTurn(monitor, params) {
2155
2155
  delivery,
2156
2156
  replyOptions: {
2157
2157
  ...turnAdoptionLifecycle ? bindIngressLifecycleToReplyOptions(turnAdoptionLifecycle) : {},
2158
- allowProgressCallbacksWhenSourceDeliverySuppressed: draftToolProgressEnabled ? true : void 0,
2158
+ allowProgressCallbacksWhenSourceDeliverySuppressed: draftProgressEnabled ? true : void 0,
2159
2159
  preserveProgressCallbackStartOrder: draftPreviewEnabled ? true : void 0,
2160
- onObservedReplyDelivery: draftToolProgressEnabled ? () => draftStream.clear() : void 0,
2160
+ onObservedReplyDelivery: draftProgressEnabled ? () => draftStream.clear() : void 0,
2161
2161
  disableBlockStreaming: draftPreviewEnabled ? true : replyOptions.disableBlockStreaming,
2162
2162
  ...suppressDefaultToolProgressMessages ? { suppressDefaultToolProgressMessages: true } : {},
2163
2163
  onModelSelected,
@@ -2189,7 +2189,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
2189
2189
  return false;
2190
2190
  },
2191
2191
  onToolStart: async (payloadValue) => {
2192
- if (!draftToolProgressEnabled) return false;
2192
+ if (!draftProgressEnabled) return false;
2193
2193
  const boundarySettled = enterBlockPreviewActivity("tool");
2194
2194
  const progressSettled = progressDraft.pushToolProgress(buildChannelProgressDraftLineForEntry(account.config, {
2195
2195
  event: "tool",
@@ -2204,7 +2204,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
2204
2204
  return visible;
2205
2205
  },
2206
2206
  onItemEvent: async (payloadLocal) => {
2207
- if (!draftToolProgressEnabled) return false;
2207
+ if (!draftProgressEnabled) return false;
2208
2208
  const boundarySettled = enterBlockPreviewActivity("tool");
2209
2209
  const progressSettled = progressDraft.pushToolProgress(buildChannelProgressDraftLineForEntry(account.config, {
2210
2210
  event: "item",
@@ -2238,6 +2238,12 @@ async function dispatchMattermostInboundTurn(monitor, params) {
2238
2238
  //#region extensions/mattermost/src/mattermost/monitor-posts.ts
2239
2239
  function createMattermostPostHandler(monitor) {
2240
2240
  const { account, botUserId, botUsername, cfg, core, groupPolicy, pairing, resources } = monitor;
2241
+ const groupsConfigPath = resolveChannelGroupsConfigPath({
2242
+ cfg,
2243
+ channel: "mattermost",
2244
+ accountId: account.accountId,
2245
+ groups: resolveChannelGroups(cfg, "mattermost", account.accountId)
2246
+ });
2241
2247
  const { resolveMattermostMedia, resolveUserInfo } = resources;
2242
2248
  const channelHistories = /* @__PURE__ */ new Map();
2243
2249
  const historyLimit = Math.max(0, account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT);
@@ -2277,6 +2283,7 @@ function createMattermostPostHandler(monitor) {
2277
2283
  const senderName = normalizeOptionalString(payload.data?.sender_name) ?? normalizeOptionalString((await resolveUserInfo(senderId))?.username) ?? senderId;
2278
2284
  const rawPostText = typeof post.message === "string" ? post.message : "";
2279
2285
  const rawText = normalizeOptionalString(rawPostText) ?? "";
2286
+ const commandBody = normalizeMention(rawText, botUsername).trim();
2280
2287
  const { effectiveReplyToId, sessionKey } = thread;
2281
2288
  const { envelopeOptions, previousTimestamp } = resolveInboundSessionEnvelopeContext({
2282
2289
  cfg,
@@ -2310,7 +2317,7 @@ function createMattermostPostHandler(monitor) {
2310
2317
  cfg,
2311
2318
  surface: "mattermost"
2312
2319
  });
2313
- const isControlCommand = allowTextCommands && core.channel.commands.isControlCommandMessage(rawText, cfg);
2320
+ const isControlCommand = allowTextCommands && core.channel.commands.isControlCommandMessage(commandBody, cfg);
2314
2321
  const accessDecision = await resolveMattermostMonitorInboundAccess({
2315
2322
  account,
2316
2323
  cfg,
@@ -2434,7 +2441,14 @@ function createMattermostPostHandler(monitor) {
2434
2441
  return;
2435
2442
  }
2436
2443
  if (mentionDecision.shouldSkip) {
2437
- monitor.logVerboseMessage(`mattermost: drop group message (missing mention channel=${channelId} sender=${senderId} requireMention=${shouldRequireMention} bypass=${shouldBypassMention} canDetectMention=${canDetectMention})`);
2444
+ logInboundDrop({
2445
+ log: monitor.runtime.log,
2446
+ channel: "mattermost",
2447
+ reason: "no mention",
2448
+ target: channelId,
2449
+ onceKey: JSON.stringify([account.accountId, channelId]),
2450
+ hint: `Mention patterns can be derived from the agent identity name. Set ${groupsConfigPath}[${JSON.stringify(channelId)}].requireMention=false to process messages without a mention. Preserve existing groups entries; when adding the first groups map, include "*": {} to keep other chats admitted.`
2451
+ });
2438
2452
  recordPendingHistory();
2439
2453
  return;
2440
2454
  }
@@ -2494,7 +2508,6 @@ function createMattermostPostHandler(monitor) {
2494
2508
  envelope: envelopeOptions
2495
2509
  })
2496
2510
  });
2497
- const commandBody = rawText.trim();
2498
2511
  const inboundHistory = historyKey && historyLimit > 0 ? createChannelHistoryWindow({ historyMap: channelHistories }).buildInboundHistory({
2499
2512
  historyKey,
2500
2513
  limit: historyLimit
@@ -2811,6 +2824,11 @@ async function monitorMattermostProvider(opts = {}) {
2811
2824
  }
2812
2825
  };
2813
2826
  const cfg = opts.config ?? core.config.current();
2827
+ const readConfig = createRuntimeConfigReader(cfg);
2828
+ const resolveDebounceMs = () => core.channel.debounce.resolveInboundDebounceMs({
2829
+ cfg: readConfig(),
2830
+ channel: "mattermost"
2831
+ });
2814
2832
  const account = resolveMattermostAccount({
2815
2833
  cfg,
2816
2834
  accountId: opts.accountId
@@ -2928,10 +2946,8 @@ async function monitorMattermostProvider(opts = {}) {
2928
2946
  const handlePost = createMattermostPostHandler(monitor);
2929
2947
  const handleReactionEvent = createMattermostReactionHandler(monitor);
2930
2948
  const debouncer = core.channel.debounce.createInboundDebouncer({
2931
- debounceMs: core.channel.debounce.resolveInboundDebounceMs({
2932
- cfg,
2933
- channel: "mattermost"
2934
- }),
2949
+ debounceMs: resolveDebounceMs(),
2950
+ resolveDebounceMs,
2935
2951
  buildKey: (entry) => {
2936
2952
  const channelId = entry.post.channel_id ?? entry.payload.data?.channel_id ?? entry.payload.broadcast?.channel_id;
2937
2953
  if (!channelId || !entry.post.user_id) return null;
@@ -2941,7 +2957,7 @@ async function monitorMattermostProvider(opts = {}) {
2941
2957
  shouldDebounce: (entry) => {
2942
2958
  if (normalizeOptionalString(entry.post.type) !== void 0 || entry.post.file_ids?.length) return false;
2943
2959
  const text = normalizeOptionalString(entry.post.message) ?? "";
2944
- return Boolean(text) && !core.channel.commands.isControlCommandMessage(text, cfg);
2960
+ return Boolean(text) && !core.channel.commands.isControlCommandMessage(normalizeMention(text, botUsername), cfg);
2945
2961
  },
2946
2962
  onFlush: (entries, createFlush) => {
2947
2963
  const last = entries.at(-1);
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "id": "mattermost",
3
+ "name": "Mattermost",
4
+ "description": "OpenClaw Mattermost channel plugin.",
3
5
  "doctorContract": {
4
6
  "configRepair": true
5
7
  },
6
- "icon": "https://cdn.simpleicons.org/mattermost",
7
8
  "activation": {
8
9
  "onStartup": false
9
10
  },
@@ -1122,7 +1123,7 @@
1122
1123
  },
1123
1124
  "streaming.progress.toolProgress": {
1124
1125
  "label": "Mattermost Progress Tool Lines",
1125
- "help": "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
1126
+ "help": "Show individual tool activity in progress drafts (default: false). Quiet drafts retain plans, approval requests, failures, and authored progress text."
1126
1127
  },
1127
1128
  "streaming.progress.commandText": {
1128
1129
  "label": "Mattermost Progress Command Text",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/mattermost",
3
- "version": "2026.9.1",
3
+ "version": "2026.9.2",
4
4
  "description": "OpenClaw Mattermost channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "zod": "4.4.3"
13
13
  },
14
14
  "peerDependencies": {
15
- "openclaw": ">=2026.9.1"
15
+ "openclaw": ">=2026.9.2"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -91,10 +91,10 @@
91
91
  "allowInvalidConfigRecovery": true
92
92
  },
93
93
  "compat": {
94
- "pluginApi": ">=2026.9.1"
94
+ "pluginApi": ">=2026.9.2"
95
95
  },
96
96
  "build": {
97
- "openclawVersion": "2026.9.1",
97
+ "openclawVersion": "2026.9.2",
98
98
  "bundledDist": false
99
99
  },
100
100
  "release": {