@openclaw/mattermost 2026.7.2-beta.7 → 2026.8.1-beta.3

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,4 +1,4 @@
1
- import { m as normalizeMattermostBaseUrl } from "./client-CqqzTcno.js";
1
+ import { m as normalizeMattermostBaseUrl } from "./client-B_hd-kwM.js";
2
2
  import { 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/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { r as isMattermostSenderAllowed } from "./monitor-auth-rctDliGZ.js";
2
- import { t as buildButtonAttachments } from "./interactions-BQXY_48h.js";
1
+ import { r as isMattermostSenderAllowed } from "./monitor-auth-CVd_4FPD.js";
2
+ import { t as buildButtonAttachments } from "./interactions-Du_EJMeN.js";
3
3
  export { buildButtonAttachments, isMattermostSenderAllowed };
@@ -1,5 +1,5 @@
1
- import { c as isMattermostConfigured, i as mattermostSetupContract, l as mattermostConfigAdapter, n as mattermostSetupWizard, o as MattermostChannelConfigSchema, r as mattermostSetupAdapter, s as describeMattermostAccount, t as mattermostPlugin, u as mattermostMeta } from "./channel-plugin-runtime-DlrMaSIu.js";
2
- import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-CL1PxV3z.js";
1
+ import { a as MattermostChannelConfigSchema, c as mattermostConfigAdapter, l as mattermostMeta, n as mattermostSetupWizard, o as describeMattermostAccount, r as mattermostSetupContract, s as isMattermostConfigured, t as mattermostPlugin } from "./channel-plugin-runtime-C_mWt_83.js";
2
+ import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
3
3
  //#region extensions/mattermost/src/channel.setup.ts
4
4
  const mattermostSetupPlugin = {
5
5
  id: "mattermost",
@@ -31,7 +31,6 @@ const mattermostSetupPlugin = {
31
31
  describeAccount: describeMattermostAccount
32
32
  },
33
33
  gateway: { resolveGatewayAuthBypassPaths: resolveMattermostGatewayAuthBypassPaths },
34
- setup: mattermostSetupAdapter,
35
34
  setupContract: mattermostSetupContract,
36
35
  setupWizard: mattermostSetupWizard
37
36
  };
@@ -1,8 +1,9 @@
1
- import { m as normalizeMattermostBaseUrl } from "./client-CqqzTcno.js";
2
- import { a as resolveMattermostReplyToMode, i as resolveMattermostAccount, n as listMattermostAccountIds, o as buildSecretInputSchema, r as resolveDefaultMattermostAccountId, s as hasConfiguredSecretInput, t as inspectMattermostAccount } from "./accounts-NaMdx9yF.js";
3
- import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-CL1PxV3z.js";
4
- import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BaUvVh8e.js";
5
- import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-B4R5Bmhv.js";
1
+ import { m as normalizeMattermostBaseUrl } from "./client-B_hd-kwM.js";
2
+ import { a as resolveMattermostReplyToMode, i as resolveMattermostAccount, n as listMattermostAccountIds, o as buildSecretInputSchema, r as resolveDefaultMattermostAccountId, s as hasConfiguredSecretInput, t as inspectMattermostAccount } from "./accounts-DspH-NMT.js";
3
+ import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.js";
4
+ import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.js";
5
+ import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.js";
6
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
6
7
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
7
8
  import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
8
9
  import { isPrivateNetworkOptInEnabled } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -10,7 +11,6 @@ import { z } from "zod";
10
11
  import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
11
12
  import { createLoggedPairingApprovalNotifier } from "openclaw/plugin-sdk/channel-pairing";
12
13
  import { createAccountStatusSink, createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
13
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
14
14
  import { jsonResult, readPositiveIntegerParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
15
15
  import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
16
16
  import { createChannelConfigUiHints, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
@@ -256,7 +256,7 @@ const MattermostChannelConfigSchema = buildChannelConfigSchema(buildMultiAccount
256
256
  "block.enabled": "Enable chunked block-style Mattermost preview delivery when channels.mattermost.streaming.mode=\"block\".",
257
257
  "block.coalesce": "Merge streamed Mattermost block replies before final delivery.",
258
258
  "preview.toolProgress": "Show tool/progress activity in the live draft preview post (default: true). Set false to hide interim tool updates while the draft preview stays active.",
259
- "preview.commandText": "Command/exec detail in preview tool-progress lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
259
+ "preview.commandText": "Command/exec detail in preview tool-progress lines: \"status\" is the safe default; \"raw\" opts into command text."
260
260
  },
261
261
  progress: {}
262
262
  })
@@ -397,47 +397,6 @@ function applyMattermostSetupConfigPatch(params) {
397
397
  patch: params.patch
398
398
  });
399
399
  }
400
- const mattermostSetupAdapter = {
401
- resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
402
- applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
403
- cfg,
404
- channelKey: channel$1,
405
- accountId,
406
- name
407
- }),
408
- validateInput: createSetupInputPresenceValidator({
409
- defaultAccountOnlyEnvError: "Mattermost env vars can only be used for the default account.",
410
- whenNotUseEnv: [{
411
- someOf: ["botToken", "token"],
412
- message: "Mattermost requires --bot-token and --http-url (or --use-env)."
413
- }, {
414
- someOf: ["httpUrl"],
415
- message: "Mattermost requires --bot-token and --http-url (or --use-env)."
416
- }],
417
- validate: ({ input }) => {
418
- const setupInput = input;
419
- const token = setupInput.botToken ?? setupInput.token;
420
- const baseUrl = normalizeMattermostBaseUrl(setupInput.httpUrl);
421
- if (!setupInput.useEnv && (!token || !baseUrl)) return "Mattermost requires --bot-token and --http-url (or --use-env).";
422
- if (setupInput.httpUrl && !baseUrl) return "Mattermost --http-url must include a valid base URL.";
423
- return null;
424
- }
425
- }),
426
- applyAccountConfig: ({ cfg, accountId, input }) => {
427
- const setupInput = input;
428
- const token = setupInput.botToken ?? setupInput.token;
429
- const baseUrl = normalizeMattermostBaseUrl(setupInput.httpUrl);
430
- return applyMattermostSetupConfigPatch({
431
- cfg,
432
- accountId,
433
- name: setupInput.name,
434
- patch: setupInput.useEnv ? {} : {
435
- ...token ? { botToken: token } : {},
436
- ...baseUrl ? { baseUrl } : {}
437
- }
438
- });
439
- }
440
- };
441
400
  const mattermostSetupContract = defineChannelSetupContract({
442
401
  fields: {
443
402
  token: {
@@ -468,10 +427,51 @@ const mattermostSetupContract = defineChannelSetupContract({
468
427
  cli: {
469
428
  flags: "--use-env",
470
429
  description: "Use Mattermost environment credentials"
471
- }
430
+ },
431
+ envVars: ["MATTERMOST_BOT_TOKEN", "MATTERMOST_URL"]
472
432
  }
473
433
  },
474
- legacyAdapter: mattermostSetupAdapter
434
+ legacyAdapter: {
435
+ resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
436
+ applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
437
+ cfg,
438
+ channelKey: channel$1,
439
+ accountId,
440
+ name
441
+ }),
442
+ validateInput: createSetupInputPresenceValidator({
443
+ defaultAccountOnlyEnvError: "Mattermost env vars can only be used for the default account.",
444
+ whenNotUseEnv: [{
445
+ someOf: ["botToken", "token"],
446
+ message: "Mattermost requires --bot-token and --http-url (or --use-env)."
447
+ }, {
448
+ someOf: ["httpUrl"],
449
+ message: "Mattermost requires --bot-token and --http-url (or --use-env)."
450
+ }],
451
+ validate: ({ input }) => {
452
+ const setupInput = input;
453
+ const token = setupInput.botToken ?? setupInput.token;
454
+ const baseUrl = normalizeMattermostBaseUrl(setupInput.httpUrl);
455
+ if (!setupInput.useEnv && (!token || !baseUrl)) return "Mattermost requires --bot-token and --http-url (or --use-env).";
456
+ if (setupInput.httpUrl && !baseUrl) return "Mattermost --http-url must include a valid base URL.";
457
+ return null;
458
+ }
459
+ }),
460
+ applyAccountConfig: ({ cfg, accountId, input }) => {
461
+ const setupInput = input;
462
+ const token = setupInput.botToken ?? setupInput.token;
463
+ const baseUrl = normalizeMattermostBaseUrl(setupInput.httpUrl);
464
+ return applyMattermostSetupConfigPatch({
465
+ cfg,
466
+ accountId,
467
+ name: setupInput.name,
468
+ patch: setupInput.useEnv ? {} : {
469
+ ...token ? { botToken: token } : {},
470
+ ...baseUrl ? { baseUrl } : {}
471
+ }
472
+ });
473
+ }
474
+ }
475
475
  });
476
476
  //#endregion
477
477
  //#region extensions/mattermost/src/setup-surface.ts
@@ -559,7 +559,7 @@ const mattermostSetupWizard = {
559
559
  };
560
560
  //#endregion
561
561
  //#region extensions/mattermost/src/channel.ts
562
- const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DndW9G7T.js"));
562
+ const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CpQzh8-1.js"));
563
563
  function buildMattermostPresentationButtons(presentation) {
564
564
  return presentation.blocks.filter((block) => block.type === "buttons").map((block) => block.buttons.flatMap((button) => {
565
565
  if (button.action) return [];
@@ -604,6 +604,7 @@ const mattermostSecurityAdapter = createRestrictSendersChannelSecurity({
604
604
  openScope: "any member",
605
605
  groupPolicyPath: "channels.mattermost.groupPolicy",
606
606
  groupAllowFromPath: "channels.mattermost.groupAllowFrom",
607
+ findingTitle: "Mattermost security warning",
607
608
  policyPathSuffix: "dmPolicy",
608
609
  normalizeDmEntry: (raw) => normalizeMattermostAllowEntry(raw)
609
610
  });
@@ -723,6 +724,7 @@ async function listMattermostDirectoryPeers(params) {
723
724
  return (await loadMattermostChannelRuntime()).listMattermostDirectoryPeers(params);
724
725
  }
725
726
  const mattermostMessageActions = {
727
+ providerOwnedReadGates: ["read"],
726
728
  describeMessageTool: describeMattermostMessageTool,
727
729
  extractToolSend: ({ args }) => extractMattermostToolSend(args),
728
730
  extractToolSendResult: ({ result, send }) => extractMattermostToolSendResult(result, send),
@@ -952,9 +954,19 @@ function resolveMattermostSendAttachmentMedia(params) {
952
954
  if (attachmentMedia.mediaUrls.length > 1) throw new Error("Mattermost send supports one attachment per message; split multiple mediaUrls or attachments[] entries into separate sends.");
953
955
  return attachmentMedia.mediaUrls[0];
954
956
  }
957
+ function toMattermostOutboundResult(result) {
958
+ const { channelId, ...delivery } = result;
959
+ return {
960
+ ...delivery,
961
+ target: {
962
+ kind: "channel",
963
+ id: channelId
964
+ }
965
+ };
966
+ }
955
967
  function createMattermostDeliveryProgressReporter(onDeliveryResult) {
956
968
  return onDeliveryResult ? async (result) => {
957
- await onDeliveryResult(attachChannelToResult("mattermost", result));
969
+ await onDeliveryResult(attachChannelToResult("mattermost", toMattermostOutboundResult(result)));
958
970
  } : void 0;
959
971
  }
960
972
  const mattermostOutbound = {
@@ -1001,7 +1013,7 @@ const mattermostOutbound = {
1001
1013
  ...ctx.payload,
1002
1014
  mediaUrl: ctx.payload.mediaUrl ?? ctx.mediaUrl
1003
1015
  }).map((url) => url.trim()).find(Boolean);
1004
- return attachChannelToResult("mattermost", await (await loadMattermostChannelRuntime()).sendMessageMattermost(ctx.to, ctx.payload.text ?? ctx.text, {
1016
+ return attachChannelToResult("mattermost", toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(ctx.to, ctx.payload.text ?? ctx.text, {
1005
1017
  cfg: ctx.cfg,
1006
1018
  accountId: ctx.accountId ?? void 0,
1007
1019
  mediaUrl,
@@ -1013,7 +1025,7 @@ const mattermostOutbound = {
1013
1025
  buttons: buttons?.length ? buttons : void 0,
1014
1026
  attachmentText,
1015
1027
  onDeliveryResult: createMattermostDeliveryProgressReporter(ctx.onDeliveryResult)
1016
- }));
1028
+ })));
1017
1029
  }
1018
1030
  return await sendTextMediaPayload({
1019
1031
  channel: "mattermost",
@@ -1034,13 +1046,13 @@ const mattermostOutbound = {
1034
1046
  },
1035
1047
  ...createAttachedChannelResultAdapter({
1036
1048
  channel: "mattermost",
1037
- sendText: async ({ cfg, to, text, accountId, replyToId, threadId, onDeliveryResult }) => await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
1049
+ sendText: async ({ cfg, to, text, accountId, replyToId, threadId, onDeliveryResult }) => toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
1038
1050
  cfg,
1039
1051
  accountId: accountId ?? void 0,
1040
1052
  replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0),
1041
1053
  onDeliveryResult: createMattermostDeliveryProgressReporter(onDeliveryResult)
1042
- }),
1043
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, replyToId, threadId, onDeliveryResult }) => await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
1054
+ })),
1055
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, replyToId, threadId, onDeliveryResult }) => toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
1044
1056
  cfg,
1045
1057
  accountId: accountId ?? void 0,
1046
1058
  mediaUrl,
@@ -1050,7 +1062,7 @@ const mattermostOutbound = {
1050
1062
  requireMediaUpload: requiresMattermostMediaUpload(mediaUrl) ? true : void 0,
1051
1063
  replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0),
1052
1064
  onDeliveryResult: createMattermostDeliveryProgressReporter(onDeliveryResult)
1053
- })
1065
+ }))
1054
1066
  })
1055
1067
  };
1056
1068
  const mattermostMessageAdapter = createChannelMessageAdapterFromOutbound({
@@ -1073,7 +1085,6 @@ const mattermostPlugin = createChatChannelPlugin({
1073
1085
  base: {
1074
1086
  id: "mattermost",
1075
1087
  meta: { ...mattermostMeta },
1076
- setup: mattermostSetupAdapter,
1077
1088
  setupContract: mattermostSetupContract,
1078
1089
  setupWizard: mattermostSetupWizard,
1079
1090
  capabilities: {
@@ -1128,6 +1139,11 @@ const mattermostPlugin = createChatChannelPlugin({
1128
1139
  targetIdComparison: "case-sensitive",
1129
1140
  defaultMarkdownTableMode: "off",
1130
1141
  normalizeTarget: normalizeMattermostMessagingTarget,
1142
+ inferTargetChatType: ({ to }) => {
1143
+ const target = normalizeMattermostMessagingTarget(to);
1144
+ if (!target) return;
1145
+ return target.startsWith("user:") || target.startsWith("@") ? "direct" : "channel";
1146
+ },
1131
1147
  resolveDeliveryTarget: ({ conversationId, parentConversationId }) => {
1132
1148
  const parent = parentConversationId?.trim();
1133
1149
  const child = conversationId.trim();
@@ -1254,4 +1270,4 @@ const mattermostPlugin = createChatChannelPlugin({
1254
1270
  outbound: mattermostOutbound
1255
1271
  });
1256
1272
  //#endregion
1257
- export { normalizeMattermostMessagingTarget as a, isMattermostConfigured$1 as c, mattermostSetupContract as i, mattermostConfigAdapter as l, mattermostSetupWizard as n, MattermostChannelConfigSchema as o, mattermostSetupAdapter as r, describeMattermostAccount as s, mattermostPlugin as t, mattermostMeta as u };
1273
+ export { MattermostChannelConfigSchema as a, mattermostConfigAdapter as c, normalizeMattermostMessagingTarget as i, mattermostMeta as l, mattermostSetupWizard as n, describeMattermostAccount as o, mattermostSetupContract as r, isMattermostConfigured$1 as s, mattermostPlugin as t };
@@ -1,2 +1,2 @@
1
- import { t as mattermostPlugin } from "./channel-plugin-runtime-DlrMaSIu.js";
1
+ import { t as mattermostPlugin } from "./channel-plugin-runtime-C_mWt_83.js";
2
2
  export { mattermostPlugin };