@openclaw/mattermost 2026.7.2-beta.3 → 2026.7.2-beta.5

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.
@@ -3,28 +3,16 @@ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runti
3
3
  import { resolveChannelPreviewStreamMode, resolveChannelStreamingBlockCoalesce, resolveChannelStreamingBlockEnabled, resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-outbound";
4
4
  import { createAccountListHelpers, hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
6
- import { resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
7
6
  import { buildSecretInputSchema, hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
8
7
  //#region extensions/mattermost/src/mattermost/accounts.ts
9
- const mattermostAccountHelpers = createAccountListHelpers("mattermost", { hasImplicitDefaultAccount: (cfg) => {
10
- const mattermost = cfg.channels?.mattermost;
11
- return Boolean(mattermost?.baseUrl?.trim() && (hasConfiguredAccountValue(mattermost.botToken) || process.env.MATTERMOST_BOT_TOKEN?.trim()));
12
- } });
13
- function listMattermostAccountIds(cfg) {
14
- return mattermostAccountHelpers.listAccountIds(cfg);
15
- }
16
- function resolveDefaultMattermostAccountId(cfg) {
17
- return mattermostAccountHelpers.resolveDefaultAccountId(cfg);
18
- }
19
- function mergeMattermostAccountConfig(cfg, accountId) {
20
- return resolveMergedAccountConfig({
21
- channelConfig: cfg.channels?.mattermost,
22
- accounts: cfg.channels?.mattermost?.accounts,
23
- accountId,
24
- omitKeys: ["defaultAccount"],
25
- nestedObjectKeys: ["commands"]
26
- });
27
- }
8
+ const { listAccountIds: listMattermostAccountIds, resolveDefaultAccountId: resolveDefaultMattermostAccountId, resolveAccountConfig: mergeMattermostAccountConfig } = createAccountListHelpers("mattermost", {
9
+ omitKeys: ["defaultAccount"],
10
+ nestedObjectKeys: ["commands"],
11
+ hasImplicitDefaultAccount: (cfg) => {
12
+ const mattermost = cfg.channels?.mattermost;
13
+ return Boolean(mattermost?.baseUrl?.trim() && (hasConfiguredAccountValue(mattermost.botToken) || process.env.MATTERMOST_BOT_TOKEN?.trim()));
14
+ }
15
+ });
28
16
  function resolveMattermostRequireMention(config) {
29
17
  if (config.chatmode === "oncall") return true;
30
18
  if (config.chatmode === "onmessage") return false;
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { r as isMattermostSenderAllowed } from "./monitor-auth-ynw9EnGC.js";
2
- import { t as buildButtonAttachments } from "./interactions-BIb5iJjA.js";
1
+ import { r as isMattermostSenderAllowed } from "./monitor-auth-BOh6zLW9.js";
2
+ import { t as buildButtonAttachments } from "./interactions-B4gg-KRm.js";
3
3
  export { buildButtonAttachments, isMattermostSenderAllowed };
@@ -1,4 +1,4 @@
1
- import { a as MattermostChannelConfigSchema, c as mattermostConfigAdapter, l as mattermostMeta, n as mattermostSetupWizard, o as describeMattermostAccount, r as mattermostSetupAdapter, s as isMattermostConfigured, t as mattermostPlugin } from "./channel-plugin-runtime-BfV83pya.js";
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-DLBTUlbh.js";
2
2
  import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-CL1PxV3z.js";
3
3
  //#region extensions/mattermost/src/channel.setup.ts
4
4
  const mattermostSetupPlugin = {
@@ -32,6 +32,7 @@ const mattermostSetupPlugin = {
32
32
  },
33
33
  gateway: { resolveGatewayAuthBypassPaths: resolveMattermostGatewayAuthBypassPaths },
34
34
  setup: mattermostSetupAdapter,
35
+ setupContract: mattermostSetupContract,
35
36
  setupWizard: mattermostSetupWizard
36
37
  };
37
38
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { p as normalizeMattermostBaseUrl } from "./client-w0lkxuKh.js";
2
- import { a as buildSecretInputSchema, i as resolveMattermostReplyToMode, n as resolveDefaultMattermostAccountId, o as hasConfiguredSecretInput, r as resolveMattermostAccount, t as listMattermostAccountIds } from "./accounts-B-GrNVwP.js";
2
+ import { a as buildSecretInputSchema, i as resolveMattermostReplyToMode, n as resolveDefaultMattermostAccountId, o as hasConfiguredSecretInput, r as resolveMattermostAccount, t as listMattermostAccountIds } from "./accounts-BR6Nl5Qf.js";
3
3
  import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-CL1PxV3z.js";
4
4
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BaUvVh8e.js";
5
5
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-B4R5Bmhv.js";
@@ -25,6 +25,7 @@ import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
25
25
  import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
26
26
  import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
27
27
  import { BlockStreamingCoalesceSchema, ChannelImplicitMentionsSchema, DmPolicySchema, GroupPolicySchema, MarkdownConfigSchema, buildChannelConfigSchema, buildGroupEntrySchema, buildMultiAccountChannelSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
28
+ import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
28
29
  import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, baseUrlTextInput, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, formatDocsLink, migrateBaseNameToDefaultAccount, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
29
30
  import { createSetupInputPresenceValidator } from "openclaw/plugin-sdk/setup-runtime";
30
31
  //#region extensions/mattermost/src/approval-auth.ts
@@ -414,27 +415,64 @@ const mattermostSetupAdapter = {
414
415
  message: "Mattermost requires --bot-token and --http-url (or --use-env)."
415
416
  }],
416
417
  validate: ({ input }) => {
417
- const token = input.botToken ?? input.token;
418
- const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
419
- if (!input.useEnv && (!token || !baseUrl)) return "Mattermost requires --bot-token and --http-url (or --use-env).";
420
- if (input.httpUrl && !baseUrl) return "Mattermost --http-url must include a valid base URL.";
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.";
421
423
  return null;
422
424
  }
423
425
  }),
424
426
  applyAccountConfig: ({ cfg, accountId, input }) => {
425
- const token = input.botToken ?? input.token;
426
- const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
427
+ const setupInput = input;
428
+ const token = setupInput.botToken ?? setupInput.token;
429
+ const baseUrl = normalizeMattermostBaseUrl(setupInput.httpUrl);
427
430
  return applyMattermostSetupConfigPatch({
428
431
  cfg,
429
432
  accountId,
430
- name: input.name,
431
- patch: input.useEnv ? {} : {
433
+ name: setupInput.name,
434
+ patch: setupInput.useEnv ? {} : {
432
435
  ...token ? { botToken: token } : {},
433
436
  ...baseUrl ? { baseUrl } : {}
434
437
  }
435
438
  });
436
439
  }
437
440
  };
441
+ const mattermostSetupContract = defineChannelSetupContract({
442
+ fields: {
443
+ token: {
444
+ kind: "string",
445
+ sensitive: true,
446
+ cli: {
447
+ flags: "--token <token>",
448
+ description: "Mattermost bot token"
449
+ }
450
+ },
451
+ botToken: {
452
+ kind: "string",
453
+ sensitive: true,
454
+ cli: {
455
+ flags: "--bot-token <token>",
456
+ description: "Mattermost bot token"
457
+ }
458
+ },
459
+ httpUrl: {
460
+ kind: "string",
461
+ cli: {
462
+ flags: "--http-url <url>",
463
+ description: "Mattermost server URL"
464
+ }
465
+ },
466
+ useEnv: {
467
+ kind: "boolean",
468
+ cli: {
469
+ flags: "--use-env",
470
+ description: "Use Mattermost environment credentials"
471
+ }
472
+ }
473
+ },
474
+ legacyAdapter: mattermostSetupAdapter
475
+ });
438
476
  //#endregion
439
477
  //#region extensions/mattermost/src/setup-surface.ts
440
478
  const t = createSetupTranslator();
@@ -521,7 +559,7 @@ const mattermostSetupWizard = {
521
559
  };
522
560
  //#endregion
523
561
  //#region extensions/mattermost/src/channel.ts
524
- const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-DbsfMgC4.js"));
562
+ const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CR1V5M8l.js"));
525
563
  function buildMattermostPresentationButtons(presentation) {
526
564
  return presentation.blocks.filter((block) => block.type === "buttons").map((block) => block.buttons.flatMap((button) => {
527
565
  if (button.action) return [];
@@ -957,6 +995,7 @@ const mattermostPlugin = createChatChannelPlugin({
957
995
  id: "mattermost",
958
996
  meta: { ...mattermostMeta },
959
997
  setup: mattermostSetupAdapter,
998
+ setupContract: mattermostSetupContract,
960
999
  setupWizard: mattermostSetupWizard,
961
1000
  capabilities: {
962
1001
  chatTypes: [
@@ -1134,4 +1173,4 @@ const mattermostPlugin = createChatChannelPlugin({
1134
1173
  outbound: mattermostOutbound
1135
1174
  });
1136
1175
  //#endregion
1137
- export { MattermostChannelConfigSchema as a, mattermostConfigAdapter as c, normalizeMattermostMessagingTarget as i, mattermostMeta as l, mattermostSetupWizard as n, describeMattermostAccount as o, mattermostSetupAdapter as r, isMattermostConfigured$1 as s, mattermostPlugin as t };
1176
+ 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 };
@@ -1,2 +1,2 @@
1
- import { t as mattermostPlugin } from "./channel-plugin-runtime-BfV83pya.js";
1
+ import { t as mattermostPlugin } from "./channel-plugin-runtime-DLBTUlbh.js";
2
2
  export { mattermostPlugin };