@openclaw/mattermost 2026.10.5-beta.4 → 2026.10.10-beta.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.
@@ -0,0 +1,2 @@
1
+ export { t as mattermostPlugin, n as mattermostSetupPlugin } from "./channel-plugin-runtime-DQaQ8YVa.mjs";
2
+ import "../channel-plugin-api.js";
@@ -1,6 +1,6 @@
1
- import { h as normalizeMattermostBaseUrl } from "./client-tv20cXIL.mjs";
1
+ import { h as normalizeMattermostBaseUrl } from "./client-CW26CnSc.mjs";
2
2
  import { t as mattermostIngressIdentity } from "./ingress-identity-D6hxfxvo.mjs";
3
- import { a as resolveMattermostPresentation, c as listMattermostAccountIds, d as resolveMattermostReplyToMode, i as requiresMattermostMediaUpload, l as resolveDefaultMattermostAccountId, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, s as isMattermostConfigured$1, t as looksLikeMattermostTargetId, u as resolveMattermostAccount } from "./normalize-B0VHjEFE.mjs";
3
+ import { a as resolveMattermostPresentation, c as listMattermostAccountIds, d as resolveMattermostReplyToMode, i as requiresMattermostMediaUpload, l as resolveDefaultMattermostAccountId, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, s as isMattermostConfigured$1, t as looksLikeMattermostTargetId, u as resolveMattermostAccount } from "./normalize-ttaISanW.mjs";
4
4
  import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-Lf99Gilr.mjs";
5
5
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CjgZkyPm.mjs";
6
6
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.mjs";
@@ -256,7 +256,7 @@ const mattermostChannelConfigUiHints = {
256
256
  implicitMentions: true,
257
257
  streaming: {
258
258
  "": "Unified Mattermost stream preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". \"progress\" keeps a single editable progress draft until final delivery.",
259
- mode: "Canonical Mattermost preview mode: \"off\" | \"partial\" | \"block\" | \"progress\".",
259
+ mode: "Mattermost preview mode: \"off\" | \"partial\" | \"block\" | \"progress\".",
260
260
  "block.enabled": "Enable chunked block-style Mattermost preview delivery when channels.mattermost.streaming.mode=\"block\".",
261
261
  "block.coalesce": "Merge streamed Mattermost block replies before final delivery.",
262
262
  "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.",
@@ -435,11 +435,7 @@ const mattermostSetupWizard = {
435
435
  inputPrompt: t("wizard.mattermost.botTokenInput"),
436
436
  resolveAccount: inspectMattermostAccount,
437
437
  accountConfigured: isMattermostConfigured,
438
- patchAccount: ({ cfg, accountId, patch }) => applyMattermostSetupConfigPatch({
439
- cfg,
440
- accountId,
441
- patch
442
- }),
438
+ patchAccount: applyMattermostSetupConfigPatch,
443
439
  set: {}
444
440
  })],
445
441
  textInputs: [baseUrlTextInput({
@@ -460,11 +456,7 @@ const mattermostSetupWizard = {
460
456
  },
461
457
  validate: (value) => normalizeMattermostBaseUrl(value) ? void 0 : "Mattermost base URL must include a valid base URL.",
462
458
  normalize: (value) => normalizeMattermostBaseUrl(value) ?? value.trim(),
463
- patchAccount: ({ cfg, accountId, patch }) => applyMattermostSetupConfigPatch({
464
- cfg,
465
- accountId,
466
- patch
467
- })
459
+ patchAccount: applyMattermostSetupConfigPatch
468
460
  })],
469
461
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false)
470
462
  };
@@ -638,7 +630,7 @@ function resolveMattermostOutboundSessionRoute(params) {
638
630
  }
639
631
  //#endregion
640
632
  //#region extensions/mattermost/src/channel.ts
641
- const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-Bz8jKJUb.mjs"));
633
+ const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-Bl2oL5mO.mjs"));
642
634
  const MATTERMOST_PRESENTATION_CAPABILITIES = {
643
635
  supported: true,
644
636
  buttons: true,
@@ -1000,6 +992,13 @@ const mattermostPlugin = createChatChannelPlugin({
1000
992
  idleMs: 1e3
1001
993
  } },
1002
994
  approvalCapability: mattermostApprovalAuth,
995
+ agentPrompt: {
996
+ customInlineButtonHint: true,
997
+ messageToolHints: ({ cfg, accountId }) => inspectMattermostAccount({
998
+ cfg,
999
+ accountId
1000
+ }).config.capabilities?.some((entry) => entry.trim().toLowerCase() === "inlinebuttons") ? ["- Inline buttons: `send` with `presentation={\"blocks\":[{\"type\":\"buttons\",\"buttons\":[{\"label\":\"Yes\",\"value\":\"yes\",\"style\":\"primary\"}]}]}`. Typed `callback` actions render as plain text."] : []
1001
+ },
1003
1002
  doctor: mattermostDoctor,
1004
1003
  groups: { resolveRequireMention: resolveMattermostGroupRequireMention },
1005
1004
  actions: mattermostMessageActions,
@@ -1103,7 +1102,7 @@ const mattermostPlugin = createChatChannelPlugin({
1103
1102
  botTokenSource: account.botTokenSource
1104
1103
  });
1105
1104
  ctx.log?.info(`[${account.accountId}] starting channel`);
1106
- return (await import("./monitor-CdOgleQo.mjs")).monitorMattermostProvider({
1105
+ return (await import("./monitor-pdTb1bbs.mjs")).monitorMattermostProvider({
1107
1106
  botToken: account.botToken ?? void 0,
1108
1107
  baseUrl: account.baseUrl ?? void 0,
1109
1108
  accountId: account.accountId,
@@ -1,11 +1,11 @@
1
- import { _ as readMattermostError, h as normalizeMattermostBaseUrl, l as fetchMattermostChannelPosts, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostMe } from "./client-tv20cXIL.mjs";
2
- import { o as resolveMattermostTrustedChatKind } from "./monitor-auth-ChM45AzT.mjs";
3
- import { c as listMattermostAccountIds, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, u as resolveMattermostAccount } from "./normalize-B0VHjEFE.mjs";
4
- import { n as resolveMattermostOpaqueTarget, t as sendMessageMattermost } from "./send-BAUVI-1U.mjs";
1
+ import { _ as readMattermostError, h as normalizeMattermostBaseUrl, l as fetchMattermostChannelPosts, r as createMattermostClient, s as fetchMattermostChannel, u as fetchMattermostMe } from "./client-CW26CnSc.mjs";
2
+ import { o as resolveMattermostTrustedChatKind } from "./monitor-auth-C5XBx6E0.mjs";
3
+ import { c as listMattermostAccountIds, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, u as resolveMattermostAccount } from "./normalize-ttaISanW.mjs";
4
+ import { n as resolveMattermostOpaqueTarget, t as sendMessageMattermost } from "./send-BLBZqBzq.mjs";
5
5
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
6
6
  import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
7
7
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
8
- import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
8
+ import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
9
9
  import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
10
10
  import { fetchWithSsrFGuard, ssrfPolicyFromPrivateNetworkOptIn } from "openclaw/plugin-sdk/ssrf-runtime";
11
11
  import { resolveAllowlistProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
@@ -180,19 +180,17 @@ async function probeMattermost(baseUrl, botToken, timeoutMs = 2500, allowPrivate
180
180
  const BOT_USER_CACHE_TTL_MS = 6e5;
181
181
  const botUserIdCache = /* @__PURE__ */ new Map();
182
182
  async function resolveBotUserId(client, cacheKey) {
183
- const rawNow = Date.now();
184
- const now = asDateTimestampMs(rawNow);
183
+ const now = Date.now();
185
184
  const cached = botUserIdCache.get(cacheKey);
186
185
  if (cached) {
187
- if (now !== void 0 && cached.expiresAt > now) return cached.userId;
186
+ if (cached.expiresAt > now) return cached.userId;
188
187
  botUserIdCache.delete(cacheKey);
189
188
  }
190
189
  const userId = (await fetchMattermostMe(client))?.id?.trim();
191
190
  if (!userId) return null;
192
- const expiresAt = resolveExpiresAtMsFromDurationMs(BOT_USER_CACHE_TTL_MS, { nowMs: rawNow });
193
- if (expiresAt !== void 0) botUserIdCache.set(cacheKey, {
191
+ botUserIdCache.set(cacheKey, {
194
192
  userId,
195
- expiresAt
193
+ expiresAt: now + BOT_USER_CACHE_TTL_MS
196
194
  });
197
195
  return userId;
198
196
  }
@@ -284,19 +284,14 @@ async function createMattermostDirectChannelWithRetry(client, userIds, options =
284
284
  const { maxRetries = 3, initialDelayMs = 1e3, maxDelayMs = 1e4, timeoutMs: rawTimeoutMs = 3e4, onRetry } = options;
285
285
  const timeoutMs = resolveTimerTimeoutMs(rawTimeoutMs, 3e4);
286
286
  return await retryAsync(async () => {
287
- const controller = new AbortController();
288
- const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
289
287
  try {
290
288
  return await client.request("/channels/direct", {
291
289
  method: "POST",
292
290
  body: JSON.stringify(userIds),
293
- signal: controller.signal,
294
291
  timeoutMs
295
292
  });
296
293
  } catch (err) {
297
294
  throw err instanceof Error ? err : new Error(String(err));
298
- } finally {
299
- clearTimeout(timeoutId);
300
295
  }
301
296
  }, {
302
297
  attempts: maxRetries + 1,
@@ -1,8 +1,8 @@
1
1
  import { n as __reExport, t as __exportAll } from "./rolldown-runtime-BBjsoOtd.mjs";
2
2
  import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
3
3
  import { r as resolveCallbackHost } from "./callback-host-Bu2cmtfI.mjs";
4
- import { y as updateMattermostPost } from "./client-tv20cXIL.mjs";
5
- import { D as sendHttpRequestRejection, T as resolveClientIp, g as isTrustedProxyAddress, h as isRequestBodyLimitError, x as readRequestBodyWithLimit } from "./monitor-auth-ChM45AzT.mjs";
4
+ import { y as updateMattermostPost } from "./client-CW26CnSc.mjs";
5
+ import { D as sendHttpRequestRejection, T as resolveClientIp, g as isTrustedProxyAddress, h as isRequestBodyLimitError, x as readRequestBodyWithLimit } from "./monitor-auth-C5XBx6E0.mjs";
6
6
  import { createHmac } from "node:crypto";
7
7
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
8
8
  import { normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -6,7 +6,7 @@ import { resolveAllowlistMatchSimple } from "openclaw/plugin-sdk/allow-from";
6
6
  import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
7
7
  import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { logTypingFailure } from "openclaw/plugin-sdk/channel-feedback";
9
- import { listSkillCommandsForAgents } from "openclaw/plugin-sdk/command-auth-native";
9
+ import { prepareSkillCommandsForAgents } from "openclaw/plugin-sdk/command-auth-native";
10
10
  import { buildPreparedModelsProviderData } from "openclaw/plugin-sdk/models-provider-runtime";
11
11
  import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
12
12
  import { resolveAllowlistProviderRuntimeGroupPolicy as resolveAllowlistProviderRuntimeGroupPolicy$1, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
@@ -170,4 +170,4 @@ async function authorizeMattermostCommandInvocation(params) {
170
170
  };
171
171
  }
172
172
  //#endregion
173
- export { resolveAllowlistProviderRuntimeGroupPolicy$1 as C, sendHttpRequestRejection as D, resolveDefaultGroupPolicy as E, warnMissingProviderGroupPolicyFallbackOnce as O, registerPluginHttpRoute as S, resolveClientIp as T, listSkillCommandsForAgents as _, resolveMattermostMonitorInboundAccess as a, logTypingFailure as b, DEFAULT_GROUP_HISTORY_LIMIT as c, createChannelMessageReplyPipeline as d, createChannelPairingController as f, isTrustedProxyAddress as g, isRequestBodyLimitError as h, normalizeMattermostAllowList as i, buildPreparedModelsProviderData as l, isDangerousNameMatchingEnabled as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, createWebhookInFlightLimiter as p, isMattermostSenderAllowed as r, shouldRetainMattermostSenderHistory as s, authorizeMattermostCommandInvocation as t, createChannelHistoryWindow as u, loadOutboundMediaFromUrl as v, resolveChannelMediaMaxBytes$1 as w, readRequestBodyWithLimit as x, logInboundDrop as y };
173
+ export { resolveAllowlistProviderRuntimeGroupPolicy$1 as C, sendHttpRequestRejection as D, resolveDefaultGroupPolicy as E, warnMissingProviderGroupPolicyFallbackOnce as O, registerPluginHttpRoute as S, resolveClientIp as T, loadOutboundMediaFromUrl as _, resolveMattermostMonitorInboundAccess as a, prepareSkillCommandsForAgents as b, DEFAULT_GROUP_HISTORY_LIMIT as c, createChannelMessageReplyPipeline as d, createChannelPairingController as f, isTrustedProxyAddress as g, isRequestBodyLimitError as h, normalizeMattermostAllowList as i, buildPreparedModelsProviderData as l, isDangerousNameMatchingEnabled as m, formatMattermostDirectMessageDropLog as n, resolveMattermostTrustedChatKind as o, createWebhookInFlightLimiter as p, isMattermostSenderAllowed as r, shouldRetainMattermostSenderHistory as s, authorizeMattermostCommandInvocation as t, createChannelHistoryWindow as u, logInboundDrop as v, resolveChannelMediaMaxBytes$1 as w, readRequestBodyWithLimit as x, logTypingFailure as y };