@openclaw/mattermost 2026.8.2 → 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.
- package/dist/.setup/channel-plugin-api-C6m2bpOe.mjs +3 -0
- package/dist/.setup/channel-plugin-api-QYe3-Ggl.mjs +39 -0
- package/dist/{channel-plugin-runtime-iEa9Cv5W.js → .setup/channel-plugin-runtime-CfJ0OZww.mjs} +7 -7
- package/dist/{channel.runtime-tEMiKAyb.js → .setup/channel.runtime-DlSWIvzW.mjs} +8 -9
- package/dist/{interactions-DN1Dzzc_.js → .setup/interactions-B3D2xNJK.mjs} +177 -6
- package/dist/{monitor-auth-DvyW7bpd.js → .setup/monitor-auth-5PSi3kAe.mjs} +1 -1
- package/dist/{normalize-BtFTWPoG.js → .setup/normalize-D6YiIrp8.mjs} +1 -1
- package/dist/.setup/secret-contract-api-Drab0Nqx.mjs +3 -0
- package/dist/{slash-state-02qPUgGO.js → .setup/slash-state-Dy4Z0JvX.mjs} +5 -5
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +2 -38
- package/dist/channel-plugin-runtime.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/gateway-auth-api.js +1 -1
- package/dist/policy-api.js +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/slash-route-api.js +1 -1
- package/package.json +4 -4
- /package/dist/{client-D3Btt1WT.js → .setup/client-D3Btt1WT.mjs} +0 -0
- /package/dist/{doctor-contract-mvORF4f6.js → .setup/doctor-contract-mvORF4f6.mjs} +0 -0
- /package/dist/{gateway-auth-bypass-B93t91oq.js → .setup/gateway-auth-bypass-B93t91oq.mjs} +0 -0
- /package/dist/{ingress-identity-DNl4yQSc.js → .setup/ingress-identity-DNl4yQSc.mjs} +0 -0
- /package/dist/{runtime-CNB4YGqJ.js → .setup/runtime-CNB4YGqJ.mjs} +0 -0
- /package/dist/{secret-contract-qg3NXRlS.js → .setup/secret-contract-qg3NXRlS.mjs} +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
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-CfJ0OZww.mjs";
|
|
3
|
+
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.mjs";
|
|
4
|
+
//#region extensions/mattermost/src/channel.setup.ts
|
|
5
|
+
const mattermostSetupPlugin = {
|
|
6
|
+
id: "mattermost",
|
|
7
|
+
meta: { ...mattermostMeta },
|
|
8
|
+
capabilities: {
|
|
9
|
+
chatTypes: [
|
|
10
|
+
"direct",
|
|
11
|
+
"channel",
|
|
12
|
+
"group",
|
|
13
|
+
"thread"
|
|
14
|
+
],
|
|
15
|
+
reactions: true,
|
|
16
|
+
threads: true,
|
|
17
|
+
media: true,
|
|
18
|
+
nativeCommands: true
|
|
19
|
+
},
|
|
20
|
+
reload: {
|
|
21
|
+
configPrefixes: ["channels.mattermost"],
|
|
22
|
+
/**
|
|
23
|
+
* accounts.default is promoted; named resolution merges only channel-wide fields
|
|
24
|
+
* plus the selected account. Runtime monitor, debounce, and ingress use accountId.
|
|
25
|
+
*/
|
|
26
|
+
accountScopedRestart: true
|
|
27
|
+
},
|
|
28
|
+
configSchema: MattermostChannelConfigSchema,
|
|
29
|
+
config: {
|
|
30
|
+
...mattermostConfigAdapter,
|
|
31
|
+
isConfigured: isMattermostConfigured,
|
|
32
|
+
describeAccount: describeMattermostAccount
|
|
33
|
+
},
|
|
34
|
+
gateway: { resolveGatewayAuthBypassPaths: resolveMattermostGatewayAuthBypassPaths },
|
|
35
|
+
setupContract: mattermostSetupContract,
|
|
36
|
+
setupWizard: mattermostSetupWizard
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { mattermostSetupPlugin as t };
|
package/dist/{channel-plugin-runtime-iEa9Cv5W.js → .setup/channel-plugin-runtime-CfJ0OZww.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { m as normalizeMattermostBaseUrl } from "./client-D3Btt1WT.
|
|
2
|
-
import { t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.
|
|
3
|
-
import { a as inspectMattermostAccount, c as resolveDefaultMattermostAccountId, d as buildSecretInputSchema, f as hasConfiguredSecretInput, i as resolveMattermostPresentation, l as resolveMattermostAccount, n as normalizeMattermostMessagingTarget, o as isMattermostConfigured$1, r as requiresMattermostMediaUpload, s as listMattermostAccountIds, t as looksLikeMattermostTargetId, u as resolveMattermostReplyToMode } from "./normalize-
|
|
4
|
-
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.
|
|
5
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.
|
|
6
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.
|
|
1
|
+
import { m as normalizeMattermostBaseUrl } from "./client-D3Btt1WT.mjs";
|
|
2
|
+
import { t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.mjs";
|
|
3
|
+
import { a as inspectMattermostAccount, c as resolveDefaultMattermostAccountId, d as buildSecretInputSchema, f as hasConfiguredSecretInput, i as resolveMattermostPresentation, l as resolveMattermostAccount, n as normalizeMattermostMessagingTarget, o as isMattermostConfigured$1, r as requiresMattermostMediaUpload, s as listMattermostAccountIds, t as looksLikeMattermostTargetId, u as resolveMattermostReplyToMode } from "./normalize-D6YiIrp8.mjs";
|
|
4
|
+
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.mjs";
|
|
5
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.mjs";
|
|
6
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.mjs";
|
|
7
7
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
9
9
|
import { isPrivateNetworkOptInEnabled } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -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-
|
|
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 { n as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { n as normalizeMattermostAllowEntry } from "./ingress-identity-DNl4yQSc.
|
|
6
|
-
import { a as inspectMattermostAccount, l as resolveMattermostAccount, n as normalizeMattermostMessagingTarget, s as listMattermostAccountIds, u as resolveMattermostReplyToMode } from "./normalize-
|
|
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-
|
|
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";
|
|
2
|
+
import { n as getOptionalMattermostRuntime, t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
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";
|
|
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";
|
|
5
|
+
import { n as normalizeMattermostAllowEntry } from "./ingress-identity-DNl4yQSc.mjs";
|
|
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-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({
|
|
@@ -1,10 +1,181 @@
|
|
|
1
|
-
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.
|
|
2
|
-
import { v as updateMattermostPost } from "./client-D3Btt1WT.
|
|
3
|
-
import { S as resolveClientIp, p as isTrustedProxyAddress, v as readRequestBodyWithLimit } from "./monitor-auth-
|
|
1
|
+
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
2
|
+
import { v as updateMattermostPost } from "./client-D3Btt1WT.mjs";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeMattermostAllowEntry, t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.
|
|
1
|
+
import { n as normalizeMattermostAllowEntry, t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.mjs";
|
|
2
2
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
|
|
4
4
|
import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as normalizeMattermostBaseUrl } from "./client-D3Btt1WT.
|
|
1
|
+
import { m as normalizeMattermostBaseUrl } from "./client-D3Btt1WT.mjs";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { resolveChannelPreviewStreamMode, resolveChannelStreamingBlockCoalesce, resolveChannelStreamingBlockEnabled, resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { createAccountListHelpers, hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-helpers";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
import { i as resolveMattermostPresentation, l as resolveMattermostAccount, r as requiresMattermostMediaUpload } from "./normalize-
|
|
1
|
+
import { c as setInteractionSecret, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-B3D2xNJK.mjs";
|
|
2
|
+
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
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";
|
|
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";
|
|
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";
|
|
8
8
|
import { asFiniteNumber, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as buildButtonAttachments } from "./.setup/interactions-B3D2xNJK.mjs";
|
|
2
|
+
import { r as isMattermostSenderAllowed } from "./.setup/monitor-auth-5PSi3kAe.mjs";
|
|
3
3
|
export { buildButtonAttachments, isMattermostSenderAllowed };
|
|
@@ -1,39 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
|
|
4
|
-
//#region extensions/mattermost/src/channel.setup.ts
|
|
5
|
-
const mattermostSetupPlugin = {
|
|
6
|
-
id: "mattermost",
|
|
7
|
-
meta: { ...mattermostMeta },
|
|
8
|
-
capabilities: {
|
|
9
|
-
chatTypes: [
|
|
10
|
-
"direct",
|
|
11
|
-
"channel",
|
|
12
|
-
"group",
|
|
13
|
-
"thread"
|
|
14
|
-
],
|
|
15
|
-
reactions: true,
|
|
16
|
-
threads: true,
|
|
17
|
-
media: true,
|
|
18
|
-
nativeCommands: true
|
|
19
|
-
},
|
|
20
|
-
reload: {
|
|
21
|
-
configPrefixes: ["channels.mattermost"],
|
|
22
|
-
/**
|
|
23
|
-
* accounts.default is promoted; named resolution merges only channel-wide fields
|
|
24
|
-
* plus the selected account. Runtime monitor, debounce, and ingress use accountId.
|
|
25
|
-
*/
|
|
26
|
-
accountScopedRestart: true
|
|
27
|
-
},
|
|
28
|
-
configSchema: MattermostChannelConfigSchema,
|
|
29
|
-
config: {
|
|
30
|
-
...mattermostConfigAdapter,
|
|
31
|
-
isConfigured: isMattermostConfigured,
|
|
32
|
-
describeAccount: describeMattermostAccount
|
|
33
|
-
},
|
|
34
|
-
gateway: { resolveGatewayAuthBypassPaths: resolveMattermostGatewayAuthBypassPaths },
|
|
35
|
-
setupContract: mattermostSetupContract,
|
|
36
|
-
setupWizard: mattermostSetupWizard
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
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";
|
|
39
3
|
export { mattermostPlugin, mattermostSetupPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as mattermostPlugin } from "
|
|
1
|
+
import { t as mattermostPlugin } from "./.setup/channel-plugin-runtime-CfJ0OZww.mjs";
|
|
2
2
|
export { mattermostPlugin };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./.setup/doctor-contract-mvORF4f6.mjs";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
package/dist/gateway-auth-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as resolveMattermostGatewayAuthBypassPaths } from "
|
|
1
|
+
import { t as resolveMattermostGatewayAuthBypassPaths } from "./.setup/gateway-auth-bypass-B93t91oq.mjs";
|
|
2
2
|
export { resolveMattermostGatewayAuthBypassPaths as resolveGatewayAuthBypassPaths };
|
package/dist/policy-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as isMattermostSenderAllowed } from "
|
|
1
|
+
import { r as isMattermostSenderAllowed } from "./.setup/monitor-auth-5PSi3kAe.mjs";
|
|
2
2
|
export { isMattermostSenderAllowed };
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as setMattermostRuntime } from "
|
|
1
|
+
import { r as setMattermostRuntime } from "./.setup/runtime-CNB4YGqJ.mjs";
|
|
2
2
|
import { formatInboundFromLabel, logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
|
|
3
3
|
import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
|
|
4
4
|
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./.setup/secret-contract-qg3NXRlS.mjs";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
2
3
|
//#region extensions/mattermost/setup-entry.ts
|
|
3
4
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
5
|
importMetaUrl: import.meta.url,
|
|
5
6
|
plugin: {
|
|
6
|
-
specifier: "
|
|
7
|
+
specifier: fileURLToPath(new URL(".setup/channel-plugin-api-C6m2bpOe.mjs", import.meta.url).href),
|
|
7
8
|
exportName: "mattermostSetupPlugin"
|
|
8
9
|
},
|
|
9
10
|
secrets: {
|
|
10
|
-
specifier: "
|
|
11
|
+
specifier: fileURLToPath(new URL(".setup/secret-contract-api-Drab0Nqx.mjs", import.meta.url).href),
|
|
11
12
|
exportName: "channelSecrets"
|
|
12
13
|
}
|
|
13
14
|
});
|
package/dist/slash-route-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as registerSlashCommandRoute } from "
|
|
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.
|
|
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.
|
|
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.
|
|
94
|
+
"pluginApi": ">=2026.8.34"
|
|
95
95
|
},
|
|
96
96
|
"build": {
|
|
97
|
-
"openclawVersion": "2026.8.
|
|
97
|
+
"openclawVersion": "2026.8.34",
|
|
98
98
|
"bundledDist": false
|
|
99
99
|
},
|
|
100
100
|
"release": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|