@openclaw/mattermost 2026.8.2 → 2026.9.1
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/api.js +2 -2
- package/dist/channel-plugin-api.js +2 -2
- package/dist/{channel-plugin-runtime-iEa9Cv5W.js → channel-plugin-runtime-C6tfh14W.js} +6 -59
- package/dist/channel-plugin-runtime.js +1 -1
- package/dist/{channel.runtime-tEMiKAyb.js → channel.runtime-CdT1mcEl.js} +6 -6
- package/dist/{client-D3Btt1WT.js → client-Dt7Q-j5B.js} +2 -2
- package/dist/{interactions-DN1Dzzc_.js → interactions-DF1FH27_.js} +21 -10
- package/dist/{monitor-auth-DvyW7bpd.js → monitor-auth-C6RGYyn-.js} +3 -2
- package/dist/{normalize-BtFTWPoG.js → normalize-R-ATEEHC.js} +1 -1
- package/dist/policy-api.js +1 -1
- package/dist/slash-route-api.js +1 -1
- package/dist/{slash-state-02qPUgGO.js → slash-state-njvQCdwt.js} +12 -20
- package/package.json +4 -4
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as buildButtonAttachments } from "./interactions-DF1FH27_.js";
|
|
2
|
+
import { r as isMattermostSenderAllowed } from "./monitor-auth-C6RGYyn-.js";
|
|
3
3
|
export { buildButtonAttachments, isMattermostSenderAllowed };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as isMattermostConfigured } from "./normalize-
|
|
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-
|
|
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";
|
|
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 = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as normalizeMattermostBaseUrl } from "./client-
|
|
1
|
+
import { m as normalizeMattermostBaseUrl } from "./client-Dt7Q-j5B.js";
|
|
2
2
|
import { t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.js";
|
|
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-
|
|
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-R-ATEEHC.js";
|
|
4
4
|
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
|
|
5
5
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.js";
|
|
6
6
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.js";
|
|
@@ -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-CdT1mcEl.js"));
|
|
598
598
|
const MATTERMOST_PRESENTATION_CAPABILITIES = {
|
|
599
599
|
supported: true,
|
|
600
600
|
buttons: true,
|
|
@@ -676,22 +676,6 @@ function extractMattermostToolSend(args) {
|
|
|
676
676
|
...threadSuppressed ? { threadSuppressed: true } : {}
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
|
-
function extractMattermostToolSendResult(result, send) {
|
|
680
|
-
if (!result || typeof result !== "object") return null;
|
|
681
|
-
const details = result.details;
|
|
682
|
-
if (!details || typeof details !== "object") return null;
|
|
683
|
-
const toolSend = details.toolSend;
|
|
684
|
-
if (!toolSend || typeof toolSend !== "object") return null;
|
|
685
|
-
const record = toolSend;
|
|
686
|
-
const to = normalizeOptionalString(record.to);
|
|
687
|
-
if (!to) return null;
|
|
688
|
-
const threadId = normalizeOptionalString(record.threadId);
|
|
689
|
-
const originalTarget = normalizeOptionalString(send.to);
|
|
690
|
-
return {
|
|
691
|
-
to: originalTarget?.startsWith("user:") === true || originalTarget?.startsWith("@") === true ? originalTarget : to,
|
|
692
|
-
...threadId ? { threadId } : {}
|
|
693
|
-
};
|
|
694
|
-
}
|
|
695
679
|
function resolveMattermostAutoThreadId(params) {
|
|
696
680
|
const replyToId = normalizeOptionalString(params.replyToId);
|
|
697
681
|
const context = params.toolContext;
|
|
@@ -752,7 +736,6 @@ const mattermostMessageActions = {
|
|
|
752
736
|
providerOwnedReadGates: ["read"],
|
|
753
737
|
describeMessageTool: describeMattermostMessageTool,
|
|
754
738
|
extractToolSend: ({ args }) => extractMattermostToolSend(args),
|
|
755
|
-
extractToolSendResult: ({ result, send }) => extractMattermostToolSendResult(result, send),
|
|
756
739
|
prepareSendPayload: ({ ctx, payload }) => {
|
|
757
740
|
if (ctx.action !== "send") return null;
|
|
758
741
|
const mediaUrl = resolveMattermostSendAttachmentMedia(ctx.params);
|
|
@@ -774,9 +757,9 @@ const mattermostMessageActions = {
|
|
|
774
757
|
};
|
|
775
758
|
},
|
|
776
759
|
supportsAction: ({ action }) => {
|
|
777
|
-
return action === "
|
|
760
|
+
return action === "react" || action === "read";
|
|
778
761
|
},
|
|
779
|
-
handleAction: async ({ action, params, cfg, accountId,
|
|
762
|
+
handleAction: async ({ action, params, cfg, accountId, conversationReadOrigin, requesterAccountId, toolContext }) => {
|
|
780
763
|
if (action === "read") {
|
|
781
764
|
const resolvedAccountId = accountId ?? resolveDefaultMattermostAccountId(cfg);
|
|
782
765
|
const mattermostConfig = cfg.channels?.mattermost;
|
|
@@ -860,43 +843,7 @@ const mattermostMessageActions = {
|
|
|
860
843
|
details: {}
|
|
861
844
|
};
|
|
862
845
|
}
|
|
863
|
-
|
|
864
|
-
const to = typeof params.to === "string" ? params.to.trim() : typeof params.target === "string" ? params.target.trim() : "";
|
|
865
|
-
if (!to) throw new Error("Mattermost send requires a target (to).");
|
|
866
|
-
const { text: message, buttons } = resolveMattermostPresentation({
|
|
867
|
-
text: typeof params.message === "string" ? params.message : void 0,
|
|
868
|
-
presentation: params.presentation
|
|
869
|
-
});
|
|
870
|
-
const replyToId = normalizeOptionalString(params.replyToId) ?? normalizeOptionalString(params.threadId) ?? normalizeOptionalString(params.replyTo);
|
|
871
|
-
const resolvedAccountId = accountId || void 0;
|
|
872
|
-
const mediaUrl = resolveMattermostSendAttachmentMedia(params);
|
|
873
|
-
const result = await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, message, {
|
|
874
|
-
cfg,
|
|
875
|
-
accountId: resolvedAccountId,
|
|
876
|
-
replyToId,
|
|
877
|
-
buttons: buttons.length > 0 ? buttons : void 0,
|
|
878
|
-
attachmentText: typeof params.attachmentText === "string" ? params.attachmentText : void 0,
|
|
879
|
-
mediaUrl,
|
|
880
|
-
mediaLocalRoots: mediaLocalRoots ?? mediaAccess?.localRoots,
|
|
881
|
-
mediaReadFile: mediaReadFile ?? mediaAccess?.readFile,
|
|
882
|
-
...mediaAccess?.workspaceDir ? { workspaceDir: mediaAccess.workspaceDir } : {},
|
|
883
|
-
requireMediaUpload: requiresMattermostMediaUpload(mediaUrl) ? true : void 0
|
|
884
|
-
});
|
|
885
|
-
return {
|
|
886
|
-
content: [{
|
|
887
|
-
type: "text",
|
|
888
|
-
text: JSON.stringify({
|
|
889
|
-
ok: true,
|
|
890
|
-
channel: "mattermost",
|
|
891
|
-
messageId: result.messageId,
|
|
892
|
-
channelId: result.channelId
|
|
893
|
-
})
|
|
894
|
-
}],
|
|
895
|
-
details: { toolSend: {
|
|
896
|
-
to: `channel:${result.channelId}`,
|
|
897
|
-
...replyToId ? { threadId: replyToId } : {}
|
|
898
|
-
} }
|
|
899
|
-
};
|
|
846
|
+
throw new Error(`Unsupported Mattermost action: ${action}`);
|
|
900
847
|
}
|
|
901
848
|
};
|
|
902
849
|
function parseMattermostReactActionParams(params) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as mattermostPlugin } from "./channel-plugin-runtime-
|
|
1
|
+
import { t as mattermostPlugin } from "./channel-plugin-runtime-C6tfh14W.js";
|
|
2
2
|
export { mattermostPlugin };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as getOptionalMattermostRuntime, t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
2
|
+
import { a as resolveInteractionCallbackPath, c as setInteractionSecret, i as createMattermostInteractionHandler, n as buildButtonProps, r as computeInteractionCallbackUrl, s as setInteractionCallbackUrl } from "./interactions-DF1FH27_.js";
|
|
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-Dt7Q-j5B.js";
|
|
4
|
+
import { C as resolveDefaultGroupPolicy, T as warnMissingProviderGroupPolicyFallbackOnce, _ 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, x as resolveChannelMediaMaxBytes, y as registerPluginHttpRoute } from "./monitor-auth-C6RGYyn-.js";
|
|
5
5
|
import { n as normalizeMattermostAllowEntry } from "./ingress-identity-DNl4yQSc.js";
|
|
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-
|
|
6
|
+
import { a as inspectMattermostAccount, l as resolveMattermostAccount, n as normalizeMattermostMessagingTarget, s as listMattermostAccountIds, u as resolveMattermostReplyToMode } from "./normalize-R-ATEEHC.js";
|
|
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-njvQCdwt.js";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
|
|
10
10
|
import { resolvePinnedMainDmOwnerFromAllowlist, sanitizeUntrustedFileName } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -19,6 +19,7 @@ import { z } from "zod";
|
|
|
19
19
|
import { bindIngressLifecycleToReplyOptions, buildChannelProgressDraftLineForEntry, createChannelIngressError, createChannelIngressMonitor, createChannelProgressDraftCompositor, createFinalizableDraftLifecycle, createMessageReceiptFromOutboundResults, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, listMessageReceiptPlatformIds, resolveChannelStreamingPreviewToolProgress } from "openclaw/plugin-sdk/channel-outbound";
|
|
20
20
|
import { resolveAllowlistProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
21
21
|
import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
|
|
22
|
+
import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
22
23
|
import { fanInChannelIngressLifecycles, resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
23
24
|
import { buildTtsSupplementMediaPayload, countOutboundMedia, getReplyPayloadTtsSupplement, isReasoningReplyPayload, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
24
25
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
@@ -31,7 +32,6 @@ import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
|
31
32
|
import { channelReadyPatch, isLoopbackHost } from "openclaw/plugin-sdk/gateway-runtime";
|
|
32
33
|
import { captureWsEvent, createDebugProxyWebSocketAgent, resolveDebugProxySettings } from "openclaw/plugin-sdk/proxy-capture";
|
|
33
34
|
import WebSocket from "ws";
|
|
34
|
-
import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
35
35
|
import { resolveChannelContextVisibilityMode, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
36
36
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
37
37
|
import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
+
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
2
3
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
3
4
|
import { collectErrorGraphCandidates } from "openclaw/plugin-sdk/error-runtime";
|
|
4
5
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
@@ -353,8 +354,7 @@ async function deleteMattermostPost(client, postId) {
|
|
|
353
354
|
async function uploadMattermostFile(client, params) {
|
|
354
355
|
const form = new FormData();
|
|
355
356
|
const fileName = normalizeOptionalString(params.fileName) ?? "upload";
|
|
356
|
-
const
|
|
357
|
-
const blob = params.contentType ? new Blob([bytes], { type: params.contentType }) : new Blob([bytes]);
|
|
357
|
+
const blob = new Blob([bufferToBlobPart(params.buffer)], { type: params.contentType });
|
|
358
358
|
form.append("files", blob, fileName);
|
|
359
359
|
form.append("channel_id", params.channelId);
|
|
360
360
|
const res = await client.fetchImpl(`${client.apiBaseUrl}/files`, {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
|
|
2
|
-
import { v as updateMattermostPost } from "./client-
|
|
3
|
-
import { S as resolveClientIp, p as isTrustedProxyAddress, v as readRequestBodyWithLimit } from "./monitor-auth-
|
|
2
|
+
import { v as updateMattermostPost } from "./client-Dt7Q-j5B.js";
|
|
3
|
+
import { S as resolveClientIp, f as isRequestBodyLimitError, p as isTrustedProxyAddress, v as readRequestBodyWithLimit, w as sendHttpRequestRejection } from "./monitor-auth-C6RGYyn-.js";
|
|
4
4
|
import { createHmac } from "node:crypto";
|
|
5
5
|
import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
|
|
6
6
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
7
7
|
import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
//#region extensions/mattermost/src/mattermost/callback-host.ts
|
|
9
|
+
function isWildcardBindHost(rawHost) {
|
|
10
|
+
const trimmed = rawHost.trim();
|
|
11
|
+
if (!trimmed) return false;
|
|
12
|
+
const host = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.slice(1, -1) : trimmed;
|
|
13
|
+
return host === "0.0.0.0" || host === "::" || host === "0:0:0:0:0:0:0:0" || host === "::0";
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
8
16
|
//#region extensions/mattermost/src/mattermost/interactions.ts
|
|
9
17
|
const INTERACTION_MAX_BODY_BYTES = 65536;
|
|
10
18
|
const INTERACTION_BODY_TIMEOUT_MS = 1e4;
|
|
@@ -16,12 +24,6 @@ function setInteractionCallbackUrl(accountId, url) {
|
|
|
16
24
|
function resolveInteractionCallbackPath(accountId) {
|
|
17
25
|
return `/mattermost/interactions/${accountId}`;
|
|
18
26
|
}
|
|
19
|
-
function isWildcardBindHost(rawHost) {
|
|
20
|
-
const trimmed = rawHost.trim();
|
|
21
|
-
if (!trimmed) return false;
|
|
22
|
-
const host = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.slice(1, -1) : trimmed;
|
|
23
|
-
return host === "0.0.0.0" || host === "::" || host === "0:0:0:0:0:0:0:0" || host === "::0";
|
|
24
|
-
}
|
|
25
27
|
function normalizeCallbackBaseUrl(baseUrl) {
|
|
26
28
|
return baseUrl.trim().replace(/\/+$/, "");
|
|
27
29
|
}
|
|
@@ -167,7 +169,8 @@ function buildButtonProps(params) {
|
|
|
167
169
|
function readInteractionBody(req) {
|
|
168
170
|
return readRequestBodyWithLimit(req, {
|
|
169
171
|
maxBytes: INTERACTION_MAX_BODY_BYTES,
|
|
170
|
-
timeoutMs: INTERACTION_BODY_TIMEOUT_MS
|
|
172
|
+
timeoutMs: INTERACTION_BODY_TIMEOUT_MS,
|
|
173
|
+
destroyOnLimit: false
|
|
171
174
|
});
|
|
172
175
|
}
|
|
173
176
|
function createMattermostInteractionHandler(params) {
|
|
@@ -205,6 +208,14 @@ function createMattermostInteractionHandler(params) {
|
|
|
205
208
|
payload = parseInteractionPayload(await readInteractionBody(req));
|
|
206
209
|
} catch (err) {
|
|
207
210
|
log?.(`mattermost interaction: failed to parse body: ${String(err)}`);
|
|
211
|
+
if (isRequestBodyLimitError(err, "PAYLOAD_TOO_LARGE")) {
|
|
212
|
+
await sendHttpRequestRejection(req, res, 413, JSON.stringify({ error: "Payload too large" }), "application/json");
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (isRequestBodyLimitError(err, "REQUEST_BODY_TIMEOUT")) {
|
|
216
|
+
await sendHttpRequestRejection(req, res, 408, JSON.stringify({ error: "Request body timeout" }), "application/json");
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
208
219
|
res.statusCode = 400;
|
|
209
220
|
res.setHeader("Content-Type", "application/json");
|
|
210
221
|
res.end(JSON.stringify({ error: "Invalid request body" }));
|
|
@@ -375,4 +386,4 @@ function createMattermostInteractionHandler(params) {
|
|
|
375
386
|
};
|
|
376
387
|
}
|
|
377
388
|
//#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 };
|
|
389
|
+
export { resolveInteractionCallbackPath as a, setInteractionSecret as c, createMattermostInteractionHandler as i, isWildcardBindHost as l, buildButtonProps as n, resolveInteractionCallbackUrl as o, computeInteractionCallbackUrl as r, setInteractionCallbackUrl as s, buildButtonAttachments as t };
|
|
@@ -13,7 +13,8 @@ import { resolveChannelMediaMaxBytes as resolveChannelMediaMaxBytes$1 } from "op
|
|
|
13
13
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
14
14
|
import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
15
15
|
import { registerPluginHttpRoute } from "openclaw/plugin-sdk/webhook-targets";
|
|
16
|
-
import { isRequestBodyLimitError
|
|
16
|
+
import { isRequestBodyLimitError } from "openclaw/plugin-sdk/webhook-ingress";
|
|
17
|
+
import { readRequestBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
17
18
|
import { isTrustedProxyAddress, resolveClientIp } from "openclaw/plugin-sdk/core";
|
|
18
19
|
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
20
|
//#region extensions/mattermost/src/mattermost/monitor-auth.ts
|
|
@@ -161,4 +162,4 @@ async function authorizeMattermostCommandInvocation(params) {
|
|
|
161
162
|
};
|
|
162
163
|
}
|
|
163
164
|
//#endregion
|
|
164
|
-
export { resolveDefaultGroupPolicy as C, resolveClientIp as S, logTypingFailure as _, resolveMattermostMonitorInboundAccess as a, resolveAllowlistProviderRuntimeGroupPolicy$1 as b, buildPreparedModelsProviderData as c, createChannelPairingController as d, isRequestBodyLimitError as f, logInboundDrop as g, loadOutboundMediaFromUrl as h, normalizeMattermostAllowList as i, createChannelHistoryWindow as l, listSkillCommandsForAgents as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, isTrustedProxyAddress as p, isMattermostSenderAllowed as r, DEFAULT_GROUP_HISTORY_LIMIT as s, authorizeMattermostCommandInvocation as t, createChannelMessageReplyPipeline as u, readRequestBodyWithLimit as v,
|
|
165
|
+
export { resolveDefaultGroupPolicy as C, resolveClientIp as S, warnMissingProviderGroupPolicyFallbackOnce as T, logTypingFailure as _, resolveMattermostMonitorInboundAccess as a, resolveAllowlistProviderRuntimeGroupPolicy$1 as b, buildPreparedModelsProviderData as c, createChannelPairingController as d, isRequestBodyLimitError as f, logInboundDrop as g, loadOutboundMediaFromUrl as h, normalizeMattermostAllowList as i, createChannelHistoryWindow as l, listSkillCommandsForAgents as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, isTrustedProxyAddress as p, isMattermostSenderAllowed as r, DEFAULT_GROUP_HISTORY_LIMIT as s, authorizeMattermostCommandInvocation as t, createChannelMessageReplyPipeline as u, readRequestBodyWithLimit as v, sendHttpRequestRejection as w, resolveChannelMediaMaxBytes$1 as x, registerPluginHttpRoute as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as normalizeMattermostBaseUrl } from "./client-
|
|
1
|
+
import { m as normalizeMattermostBaseUrl } from "./client-Dt7Q-j5B.js";
|
|
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";
|
package/dist/policy-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { r as isMattermostSenderAllowed } from "./monitor-auth-
|
|
1
|
+
import { r as isMattermostSenderAllowed } from "./monitor-auth-C6RGYyn-.js";
|
|
2
2
|
export { isMattermostSenderAllowed };
|
package/dist/slash-route-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as registerSlashCommandRoute } from "./slash-state-
|
|
1
|
+
import { i as registerSlashCommandRoute } from "./slash-state-njvQCdwt.js";
|
|
2
2
|
export { registerSlashCommandRoute };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
import { i as resolveMattermostPresentation, l as resolveMattermostAccount, r as requiresMattermostMediaUpload } from "./normalize-
|
|
2
|
+
import { c as setInteractionSecret, l as isWildcardBindHost, n as buildButtonProps, o as resolveInteractionCallbackUrl } from "./interactions-DF1FH27_.js";
|
|
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-Dt7Q-j5B.js";
|
|
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, w as sendHttpRequestRejection } from "./monitor-auth-C6RGYyn-.js";
|
|
5
|
+
import { i as resolveMattermostPresentation, l as resolveMattermostAccount, r as requiresMattermostMediaUpload } from "./normalize-R-ATEEHC.js";
|
|
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";
|
|
@@ -341,12 +341,6 @@ function isSlashCommandsEnabled(config) {
|
|
|
341
341
|
*/
|
|
342
342
|
function resolveCallbackUrl(params) {
|
|
343
343
|
if (params.config.callbackUrl) return params.config.callbackUrl;
|
|
344
|
-
const isWildcardBindHost = (rawHost) => {
|
|
345
|
-
const trimmed = rawHost.trim();
|
|
346
|
-
if (!trimmed) return false;
|
|
347
|
-
const host = trimmed.startsWith("[") && trimmed.endsWith("]") ? trimmed.slice(1, -1) : trimmed;
|
|
348
|
-
return host === "0.0.0.0" || host === "::" || host === "0:0:0:0:0:0:0:0" || host === "::0";
|
|
349
|
-
};
|
|
350
344
|
let host = params.gatewayHost && !isWildcardBindHost(params.gatewayHost) ? params.gatewayHost : "localhost";
|
|
351
345
|
const path = normalizeCallbackPath(params.config.callbackPath);
|
|
352
346
|
if (host.includes(":") && !(host.startsWith("[") && host.endsWith("]"))) host = `[${host}]`;
|
|
@@ -1174,7 +1168,8 @@ const SECRET_LOG_KEYS = /* @__PURE__ */ new Set([
|
|
|
1174
1168
|
function readBody(req, maxBytes, timeoutMs = BODY_READ_TIMEOUT_MS) {
|
|
1175
1169
|
return readRequestBodyWithLimit(req, {
|
|
1176
1170
|
maxBytes,
|
|
1177
|
-
timeoutMs
|
|
1171
|
+
timeoutMs,
|
|
1172
|
+
destroyOnLimit: false
|
|
1178
1173
|
});
|
|
1179
1174
|
}
|
|
1180
1175
|
function sendJsonResponse(res, status, body) {
|
|
@@ -1482,12 +1477,10 @@ function createSlashCommandHttpHandler(params) {
|
|
|
1482
1477
|
body = bufferedBody ?? await readBody(req, MAX_BODY_BYTES, bodyTimeoutMs);
|
|
1483
1478
|
} catch (error) {
|
|
1484
1479
|
if (isRequestBodyLimitError(error, "REQUEST_BODY_TIMEOUT")) {
|
|
1485
|
-
res
|
|
1486
|
-
res.end("Request body timeout");
|
|
1480
|
+
await sendHttpRequestRejection(req, res, 408, "Request body timeout");
|
|
1487
1481
|
return;
|
|
1488
1482
|
}
|
|
1489
|
-
res
|
|
1490
|
-
res.end("Payload Too Large");
|
|
1483
|
+
await sendHttpRequestRejection(req, res, 413, "Payload Too Large");
|
|
1491
1484
|
return;
|
|
1492
1485
|
}
|
|
1493
1486
|
const contentType = req.headers["content-type"] ?? "";
|
|
@@ -1899,16 +1892,15 @@ function registerSlashCommandRoute(api) {
|
|
|
1899
1892
|
try {
|
|
1900
1893
|
bodyStr = await readRequestBodyWithLimit(req, {
|
|
1901
1894
|
maxBytes: MULTI_ACCOUNT_BODY_MAX_BYTES,
|
|
1902
|
-
timeoutMs: MULTI_ACCOUNT_BODY_TIMEOUT_MS
|
|
1895
|
+
timeoutMs: MULTI_ACCOUNT_BODY_TIMEOUT_MS,
|
|
1896
|
+
destroyOnLimit: false
|
|
1903
1897
|
});
|
|
1904
1898
|
} catch (error) {
|
|
1905
1899
|
if (isRequestBodyLimitError(error, "REQUEST_BODY_TIMEOUT")) {
|
|
1906
|
-
res
|
|
1907
|
-
res.end("Request body timeout");
|
|
1900
|
+
await sendHttpRequestRejection(req, res, 408, "Request body timeout");
|
|
1908
1901
|
return;
|
|
1909
1902
|
}
|
|
1910
|
-
res
|
|
1911
|
-
res.end("Payload Too Large");
|
|
1903
|
+
await sendHttpRequestRejection(req, res, 413, "Payload Too Large");
|
|
1912
1904
|
return;
|
|
1913
1905
|
}
|
|
1914
1906
|
let token = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/mattermost",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.1",
|
|
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.
|
|
15
|
+
"openclaw": ">=2026.9.1"
|
|
16
16
|
},
|
|
17
17
|
"peerDependenciesMeta": {
|
|
18
18
|
"openclaw": {
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"allowInvalidConfigRecovery": true
|
|
92
92
|
},
|
|
93
93
|
"compat": {
|
|
94
|
-
"pluginApi": ">=2026.
|
|
94
|
+
"pluginApi": ">=2026.9.1"
|
|
95
95
|
},
|
|
96
96
|
"build": {
|
|
97
|
-
"openclawVersion": "2026.
|
|
97
|
+
"openclawVersion": "2026.9.1",
|
|
98
98
|
"bundledDist": false
|
|
99
99
|
},
|
|
100
100
|
"release": {
|