@openclaw/mattermost 2026.8.33 → 2026.8.34

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,3 +1,3 @@
1
- import { t as mattermostPlugin } from "./channel-plugin-runtime-5KTpFt5d.mjs";
2
- import { t as mattermostSetupPlugin } from "./channel-plugin-api-DwYqw8BB.mjs";
1
+ import { t as mattermostPlugin } from "./channel-plugin-runtime-CfJ0OZww.mjs";
2
+ import { t as mattermostSetupPlugin } from "./channel-plugin-api-QYe3-Ggl.mjs";
3
3
  export { mattermostPlugin, mattermostSetupPlugin };
@@ -1,5 +1,5 @@
1
1
  import { o as isMattermostConfigured } from "./normalize-D6YiIrp8.mjs";
2
- import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta } from "./channel-plugin-runtime-5KTpFt5d.mjs";
2
+ import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta } from "./channel-plugin-runtime-CfJ0OZww.mjs";
3
3
  import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.mjs";
4
4
  //#region extensions/mattermost/src/channel.setup.ts
5
5
  const mattermostSetupPlugin = {
@@ -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-Do4NNPx6.mjs"));
597
+ const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DlSWIvzW.mjs"));
598
598
  const MATTERMOST_PRESENTATION_CAPABILITIES = {
599
599
  supported: true,
600
600
  buttons: true,
@@ -1,12 +1,11 @@
1
+ import { a as resolveInteractionCallbackPath, c as setInteractionSecret, i as createMattermostInteractionHandler, l as gateway_config_runtime_exports, n as buildButtonProps, r as computeInteractionCallbackUrl, s as setInteractionCallbackUrl } from "./interactions-B3D2xNJK.mjs";
1
2
  import { n as getOptionalMattermostRuntime, t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
2
3
  import { _ as sendMattermostTyping, a as createMattermostPost, d as fetchMattermostUser, g as readMattermostError, l as fetchMattermostChannelPosts, m as normalizeMattermostBaseUrl, n as buildMattermostApiUrl, o as deleteMattermostPost, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, t as MattermostPostSchema, u as fetchMattermostMe, v as updateMattermostPost } from "./client-D3Btt1WT.mjs";
3
4
  import { C as resolveDefaultGroupPolicy, _ as logTypingFailure, a as resolveMattermostMonitorInboundAccess, b as resolveAllowlistProviderRuntimeGroupPolicy$1, c as buildPreparedModelsProviderData, d as createChannelPairingController, g as logInboundDrop, l as createChannelHistoryWindow, m as listSkillCommandsForAgents, n as formatMattermostDirectMessageDropLog, o as resolveMattermostTrustedChatKind, s as DEFAULT_GROUP_HISTORY_LIMIT, t as authorizeMattermostCommandInvocation, u as createChannelMessageReplyPipeline, w as warnMissingProviderGroupPolicyFallbackOnce, x as resolveChannelMediaMaxBytes, y as registerPluginHttpRoute } from "./monitor-auth-5PSi3kAe.mjs";
4
- import { a as resolveInteractionCallbackPath, c as setInteractionSecret, i as createMattermostInteractionHandler, n as buildButtonProps, r as computeInteractionCallbackUrl, s as setInteractionCallbackUrl } from "./interactions-D_JtOrNT.mjs";
5
5
  import { n as normalizeMattermostAllowEntry } from "./ingress-identity-DNl4yQSc.mjs";
6
6
  import { a as inspectMattermostAccount, l as resolveMattermostAccount, n as normalizeMattermostMessagingTarget, s as listMattermostAccountIds, u as resolveMattermostReplyToMode } from "./normalize-D6YiIrp8.mjs";
7
- import { _ as registerSlashCommands, a as sendMessageMattermost, c as joinMattermostVisibleContent, d as renderMattermostModelsPickerView, f as renderMattermostProviderPickerView, g as isSlashCommandsEnabled, h as cleanupSlashCommands, l as buildMattermostAllowedModelRefs, m as DEFAULT_COMMAND_SPECS, n as deactivateSlashCommands, o as resolveMattermostOpaqueTarget, p as resolveMattermostModelPickerCurrentModel, r as getSlashCommandState, s as deliverMattermostReplyPayload, t as activateSlashCommands, u as parseMattermostModelPickerContext, v as resolveCallbackUrl, y as resolveSlashCommandConfig } from "./slash-state-CG0pjvJi.mjs";
7
+ import { _ as registerSlashCommands, a as sendMessageMattermost, c as joinMattermostVisibleContent, d as renderMattermostModelsPickerView, f as renderMattermostProviderPickerView, g as isSlashCommandsEnabled, h as cleanupSlashCommands, l as buildMattermostAllowedModelRefs, m as DEFAULT_COMMAND_SPECS, n as deactivateSlashCommands, o as resolveMattermostOpaqueTarget, p as resolveMattermostModelPickerCurrentModel, r as getSlashCommandState, s as deliverMattermostReplyPayload, t as activateSlashCommands, u as parseMattermostModelPickerContext, v as resolveCallbackUrl, y as resolveSlashCommandConfig } from "./slash-state-Dy4Z0JvX.mjs";
8
8
  import { randomUUID } from "node:crypto";
9
- import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
10
9
  import { resolvePinnedMainDmOwnerFromAllowlist, sanitizeUntrustedFileName } from "openclaw/plugin-sdk/security-runtime";
11
10
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries, normalizeTrimmedStringList, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
12
11
  import { buildChannelInboundMediaPayload, createChannelPartialDeliveryError, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, formatMediaPlaceholderText, implicitMentionKindWhen, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundSessionEnvelopeContext, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
@@ -2673,7 +2672,7 @@ async function registerMattermostMonitorSlashCommands(params) {
2673
2672
  const teams = await fetchMattermostUserTeams(params.client, params.botUserId);
2674
2673
  const slashCallbackUrl = resolveCallbackUrl({
2675
2674
  config: slashConfig,
2676
- gatewayPort: resolveGatewayPort(params.cfg),
2675
+ gatewayPort: (0, gateway_config_runtime_exports.resolveGatewayPort)(params.cfg),
2677
2676
  gatewayHost: params.cfg.gateway?.customBindHost ?? void 0
2678
2677
  });
2679
2678
  warnOnSuspiciousCallbackUrl({
@@ -2,9 +2,180 @@ import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
2
2
  import { v as updateMattermostPost } from "./client-D3Btt1WT.mjs";
3
3
  import { S as resolveClientIp, p as isTrustedProxyAddress, v as readRequestBodyWithLimit } from "./monitor-auth-5PSi3kAe.mjs";
4
4
  import { createHmac } from "node:crypto";
5
- import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
6
5
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
7
6
  import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
+ //#region \0rolldown/runtime.js
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __exportAll = (all, no_symbols) => {
13
+ let target = {};
14
+ for (var name in all) __defProp(target, name, {
15
+ get: all[name],
16
+ enumerable: true
17
+ });
18
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
19
+ return target;
20
+ };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
23
+ key = keys[i];
24
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
25
+ get: ((k) => from[k]).bind(null, key),
26
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
+ });
28
+ }
29
+ return to;
30
+ };
31
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
32
+ //#endregion
33
+ //#region src/gateway/gateway-http-route-contracts.ts
34
+ const GATEWAY_PROBE_ROUTES = /* @__PURE__ */ new Map([
35
+ ["/health", "live"],
36
+ ["/healthz", "live"],
37
+ ["/ready", "ready"],
38
+ ["/readyz", "ready"],
39
+ ["/startup", "startup"],
40
+ ["/startupz", "startup"]
41
+ ]);
42
+ function classifyGatewayProbePath(pathname) {
43
+ for (const [root, status] of GATEWAY_PROBE_ROUTES) {
44
+ if (pathname === root) return status;
45
+ if (pathname.startsWith(`${root}/`)) return "namespace";
46
+ }
47
+ return "outside";
48
+ }
49
+ //#endregion
50
+ //#region packages/normalization-core/src/string-coerce.ts
51
+ /** Trims string input and returns null for non-strings or empty strings. */
52
+ function normalizeNullableString(value) {
53
+ if (typeof value !== "string") return null;
54
+ const trimmed = value.trim();
55
+ return trimmed ? trimmed : null;
56
+ }
57
+ /** Trims string input and returns undefined for non-strings or empty strings. */
58
+ function normalizeOptionalString$1(value) {
59
+ return normalizeNullableString(value) ?? void 0;
60
+ }
61
+ /** Lowercases a normalized optional string. */
62
+ function normalizeOptionalLowercaseString(value) {
63
+ return normalizeOptionalString$1(value)?.toLowerCase();
64
+ }
65
+ /** Lowercases a normalized string or returns an empty string when absent. */
66
+ function normalizeLowercaseStringOrEmpty$1(value) {
67
+ return normalizeOptionalLowercaseString(value) ?? "";
68
+ }
69
+ //#endregion
70
+ //#region src/gateway/security-path.ts
71
+ const MAX_PATH_DECODE_PASSES = 32;
72
+ function normalizePathSeparators(pathname) {
73
+ const collapsed = pathname.replace(/\/{2,}/g, "/");
74
+ if (collapsed.length <= 1) return collapsed;
75
+ return collapsed.replace(/\/+$/, "");
76
+ }
77
+ function resolveDotSegments(pathname) {
78
+ try {
79
+ return new URL(pathname, "http://localhost").pathname;
80
+ } catch {
81
+ return pathname;
82
+ }
83
+ }
84
+ function normalizePathForSecurity(pathname) {
85
+ return normalizePathSeparators(normalizeLowercaseStringOrEmpty$1(resolveDotSegments(pathname))) || "/";
86
+ }
87
+ function pushNormalizedCandidate(candidates, seen, value) {
88
+ const normalized = normalizePathForSecurity(value);
89
+ if (seen.has(normalized)) return;
90
+ seen.add(normalized);
91
+ candidates.push(normalized);
92
+ }
93
+ function buildCanonicalPathCandidates(pathname, maxDecodePasses = MAX_PATH_DECODE_PASSES) {
94
+ const candidates = [];
95
+ const seen = /* @__PURE__ */ new Set();
96
+ pushNormalizedCandidate(candidates, seen, pathname);
97
+ let decoded = pathname;
98
+ let malformedEncoding = false;
99
+ let decodePasses = 0;
100
+ for (let pass = 0; pass < maxDecodePasses; pass++) {
101
+ let nextDecoded;
102
+ try {
103
+ nextDecoded = decodeURIComponent(decoded);
104
+ } catch {
105
+ malformedEncoding = true;
106
+ break;
107
+ }
108
+ if (nextDecoded === decoded) break;
109
+ decodePasses += 1;
110
+ decoded = nextDecoded;
111
+ pushNormalizedCandidate(candidates, seen, decoded);
112
+ }
113
+ let decodePassLimitReached = false;
114
+ if (!malformedEncoding) try {
115
+ decodePassLimitReached = decodeURIComponent(decoded) !== decoded;
116
+ } catch {
117
+ malformedEncoding = true;
118
+ }
119
+ return {
120
+ candidates,
121
+ decodePasses,
122
+ decodePassLimitReached,
123
+ malformedEncoding
124
+ };
125
+ }
126
+ function canonicalizePathForSecurity(pathname) {
127
+ const { candidates, decodePasses, decodePassLimitReached, malformedEncoding } = buildCanonicalPathCandidates(pathname);
128
+ return {
129
+ canonicalPath: candidates[candidates.length - 1] ?? "/",
130
+ candidates,
131
+ decodePasses,
132
+ decodePassLimitReached,
133
+ malformedEncoding,
134
+ rawNormalizedPath: normalizePathSeparators(normalizeLowercaseStringOrEmpty$1(pathname)) || "/"
135
+ };
136
+ }
137
+ const PROTECTED_PLUGIN_ROUTE_PREFIXES = ["/api/channels"];
138
+ //#endregion
139
+ //#region src/gateway/server/plugins-http/path-context.ts
140
+ function normalizeProtectedPrefix(prefix) {
141
+ const collapsed = normalizeLowercaseStringOrEmpty$1(prefix).replace(/\/{2,}/g, "/");
142
+ if (collapsed.length <= 1) return collapsed || "/";
143
+ return collapsed.replace(/\/+$/, "");
144
+ }
145
+ /** Matches a normalized path against an exact protected prefix boundary. */
146
+ function prefixMatchPath(pathname, prefix) {
147
+ return pathname === prefix || pathname.startsWith(`${prefix}/`) || pathname.startsWith(`${prefix}%`);
148
+ }
149
+ const NORMALIZED_PROTECTED_PLUGIN_ROUTE_PREFIXES = PROTECTED_PLUGIN_ROUTE_PREFIXES.map(normalizeProtectedPrefix);
150
+ /** Returns true when any decoded path candidate targets a protected route. */
151
+ function isProtectedPluginRoutePathFromContext(context) {
152
+ if (context.candidates.some((candidate) => NORMALIZED_PROTECTED_PLUGIN_ROUTE_PREFIXES.some((prefix) => prefixMatchPath(candidate, prefix)))) return true;
153
+ if (context.decodePassLimitReached) return true;
154
+ if (!context.malformedEncoding) return false;
155
+ return NORMALIZED_PROTECTED_PLUGIN_ROUTE_PREFIXES.some((prefix) => prefixMatchPath(context.rawNormalizedPath, prefix));
156
+ }
157
+ /** Builds all security-relevant decoded path candidates for a request path. */
158
+ function resolvePluginRoutePathContext(pathname) {
159
+ const canonical = canonicalizePathForSecurity(pathname);
160
+ return {
161
+ pathname,
162
+ canonicalPath: canonical.canonicalPath,
163
+ candidates: canonical.candidates,
164
+ malformedEncoding: canonical.malformedEncoding,
165
+ decodePassLimitReached: canonical.decodePassLimitReached,
166
+ rawNormalizedPath: canonical.rawNormalizedPath
167
+ };
168
+ }
169
+ //#endregion
170
+ //#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/gateway-config-runtime
171
+ var gateway_config_runtime_exports = /* @__PURE__ */ __exportAll({
172
+ classifyGatewayProbePath: () => classifyGatewayProbePath,
173
+ isProtectedPluginRoutePathFromContext: () => isProtectedPluginRoutePathFromContext,
174
+ resolvePluginRoutePathContext: () => resolvePluginRoutePathContext
175
+ });
176
+ import * as import_openclaw_plugin_sdk_gateway_config_runtime from "openclaw/plugin-sdk/gateway-config-runtime";
177
+ __reExport(gateway_config_runtime_exports, import_openclaw_plugin_sdk_gateway_config_runtime);
178
+ //#endregion
8
179
  //#region extensions/mattermost/src/mattermost/interactions.ts
9
180
  const INTERACTION_MAX_BODY_BYTES = 65536;
10
181
  const INTERACTION_BODY_TIMEOUT_MS = 1e4;
@@ -49,7 +220,7 @@ function computeInteractionCallbackUrl(accountId, cfg) {
49
220
  const path = resolveInteractionCallbackPath(accountId);
50
221
  const callbackBaseUrl = normalizeOptionalString(cfg?.interactions?.callbackBaseUrl) ?? normalizeOptionalString(cfg?.channels?.mattermost?.interactions?.callbackBaseUrl);
51
222
  if (callbackBaseUrl) return `${normalizeCallbackBaseUrl(callbackBaseUrl)}${path}`;
52
- const port = resolveGatewayPort(cfg);
223
+ const port = (0, gateway_config_runtime_exports.resolveGatewayPort)(cfg);
53
224
  let host = cfg?.gateway?.customBindHost && !isWildcardBindHost(cfg.gateway.customBindHost) ? cfg.gateway.customBindHost.trim() : "localhost";
54
225
  if (host.includes(":") && !(host.startsWith("[") && host.endsWith("]"))) host = `[${host}]`;
55
226
  return `http://${host}:${port}${path}`;
@@ -375,4 +546,4 @@ function createMattermostInteractionHandler(params) {
375
546
  };
376
547
  }
377
548
  //#endregion
378
- export { resolveInteractionCallbackPath as a, setInteractionSecret as c, createMattermostInteractionHandler as i, buildButtonProps as n, resolveInteractionCallbackUrl as o, computeInteractionCallbackUrl as r, setInteractionCallbackUrl as s, buildButtonAttachments as t };
549
+ export { resolveInteractionCallbackPath as a, setInteractionSecret as c, createMattermostInteractionHandler as i, gateway_config_runtime_exports as l, buildButtonProps as n, resolveInteractionCallbackUrl as o, computeInteractionCallbackUrl as r, setInteractionCallbackUrl as s, buildButtonAttachments as t };
@@ -1,7 +1,7 @@
1
+ import { c as setInteractionSecret, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-B3D2xNJK.mjs";
1
2
  import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
2
3
  import { _ as sendMattermostTyping, a as createMattermostPost, c as fetchMattermostChannelByName, d as fetchMattermostUser, f as fetchMattermostUserByUsername, h as parseMattermostApiStatus, i as createMattermostDirectChannelWithRetry, m as normalizeMattermostBaseUrl, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostMe, y as uploadMattermostFile } from "./client-D3Btt1WT.mjs";
3
4
  import { _ as logTypingFailure, c as buildPreparedModelsProviderData, f as isRequestBodyLimitError, h as loadOutboundMediaFromUrl, i as normalizeMattermostAllowList, o as resolveMattermostTrustedChatKind, t as authorizeMattermostCommandInvocation, v as readRequestBodyWithLimit } from "./monitor-auth-5PSi3kAe.mjs";
4
- import { c as setInteractionSecret, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-D_JtOrNT.mjs";
5
5
  import { i as resolveMattermostPresentation, l as resolveMattermostAccount, r as requiresMattermostMediaUpload } from "./normalize-D6YiIrp8.mjs";
6
6
  import { createHash } from "node:crypto";
7
7
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
+ import { t as buildButtonAttachments } from "./.setup/interactions-B3D2xNJK.mjs";
1
2
  import { r as isMattermostSenderAllowed } from "./.setup/monitor-auth-5PSi3kAe.mjs";
2
- import { t as buildButtonAttachments } from "./.setup/interactions-D_JtOrNT.mjs";
3
3
  export { buildButtonAttachments, isMattermostSenderAllowed };
@@ -1,3 +1,3 @@
1
- import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-5KTpFt5d.mjs";
2
- import { t as mattermostSetupPlugin } from "./.setup/channel-plugin-api-DwYqw8BB.mjs";
1
+ import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-CfJ0OZww.mjs";
2
+ import { t as mattermostSetupPlugin } from "./.setup/channel-plugin-api-QYe3-Ggl.mjs";
3
3
  export { mattermostPlugin, mattermostSetupPlugin };
@@ -1,2 +1,2 @@
1
- import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-5KTpFt5d.mjs";
1
+ import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-CfJ0OZww.mjs";
2
2
  export { mattermostPlugin };
@@ -4,7 +4,7 @@ import { fileURLToPath } from "node:url";
4
4
  var setup_entry_default = defineBundledChannelSetupEntry({
5
5
  importMetaUrl: import.meta.url,
6
6
  plugin: {
7
- specifier: fileURLToPath(new URL(".setup/channel-plugin-api-B0CWOYS7.mjs", import.meta.url).href),
7
+ specifier: fileURLToPath(new URL(".setup/channel-plugin-api-C6m2bpOe.mjs", import.meta.url).href),
8
8
  exportName: "mattermostSetupPlugin"
9
9
  },
10
10
  secrets: {
@@ -1,2 +1,2 @@
1
- import { i as registerSlashCommandRoute } from "./.setup/slash-state-CG0pjvJi.mjs";
1
+ import { i as registerSlashCommandRoute } from "./.setup/slash-state-Dy4Z0JvX.mjs";
2
2
  export { registerSlashCommandRoute };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/mattermost",
3
- "version": "2026.8.33",
3
+ "version": "2026.8.34",
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.8.33"
15
+ "openclaw": ">=2026.8.34"
16
16
  },
17
17
  "peerDependenciesMeta": {
18
18
  "openclaw": {
@@ -91,10 +91,10 @@
91
91
  "allowInvalidConfigRecovery": true
92
92
  },
93
93
  "compat": {
94
- "pluginApi": ">=2026.8.33"
94
+ "pluginApi": ">=2026.8.34"
95
95
  },
96
96
  "build": {
97
- "openclawVersion": "2026.8.33",
97
+ "openclawVersion": "2026.8.34",
98
98
  "bundledDist": false
99
99
  },
100
100
  "release": {