From 009d4d115ada6825e6b6a8ac0b08d24d50d3da16 Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Wed, 4 Mar 2026 01:20:11 -0500 Subject: [PATCH] Extensions: migrate mattermost plugin-sdk imports --- extensions/mattermost/src/channel.test.ts | 4 ++-- extensions/mattermost/src/channel.ts | 2 +- extensions/mattermost/src/config-schema.ts | 2 +- extensions/mattermost/src/group-mentions.ts | 2 +- extensions/mattermost/src/mattermost/accounts.test.ts | 2 +- extensions/mattermost/src/mattermost/accounts.ts | 2 +- extensions/mattermost/src/mattermost/monitor-auth.ts | 5 ++++- extensions/mattermost/src/mattermost/monitor-helpers.ts | 4 ++-- .../mattermost/src/mattermost/monitor-websocket.test.ts | 2 +- extensions/mattermost/src/mattermost/monitor-websocket.ts | 2 +- extensions/mattermost/src/mattermost/monitor.authz.test.ts | 2 +- extensions/mattermost/src/mattermost/monitor.ts | 4 ++-- extensions/mattermost/src/mattermost/probe.ts | 2 +- .../mattermost/src/mattermost/reactions.test-helpers.ts | 2 +- extensions/mattermost/src/mattermost/reactions.ts | 2 +- extensions/mattermost/src/mattermost/send.ts | 2 +- extensions/mattermost/src/mattermost/slash-http.test.ts | 2 +- extensions/mattermost/src/mattermost/slash-http.ts | 4 ++-- extensions/mattermost/src/mattermost/slash-state.ts | 6 +++--- extensions/mattermost/src/onboarding-helpers.ts | 2 +- extensions/mattermost/src/onboarding.status.test.ts | 2 +- extensions/mattermost/src/onboarding.ts | 4 ++-- extensions/mattermost/src/runtime.ts | 2 +- extensions/mattermost/src/secret-input.ts | 2 +- extensions/mattermost/src/types.ts | 2 +- 25 files changed, 35 insertions(+), 32 deletions(-) diff --git a/extensions/mattermost/src/channel.test.ts b/extensions/mattermost/src/channel.test.ts index c448438278f..b0a24137c4d 100644 --- a/extensions/mattermost/src/channel.test.ts +++ b/extensions/mattermost/src/channel.test.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; -import { createReplyPrefixOptions } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import { createReplyPrefixOptions } from "openclaw/plugin-sdk/compat"; import { beforeEach, describe, expect, it, vi } from "vitest"; const { sendMessageMattermostMock } = vi.hoisted(() => ({ sendMessageMattermostMock: vi.fn(), diff --git a/extensions/mattermost/src/channel.ts b/extensions/mattermost/src/channel.ts index 9d28814fc51..a45e7b57e5b 100644 --- a/extensions/mattermost/src/channel.ts +++ b/extensions/mattermost/src/channel.ts @@ -12,7 +12,7 @@ import { type ChannelMessageActionAdapter, type ChannelMessageActionName, type ChannelPlugin, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { MattermostConfigSchema } from "./config-schema.js"; import { resolveMattermostGroupRequireMention } from "./group-mentions.js"; import { diff --git a/extensions/mattermost/src/config-schema.ts b/extensions/mattermost/src/config-schema.ts index 837facb5587..a3dd07900e2 100644 --- a/extensions/mattermost/src/config-schema.ts +++ b/extensions/mattermost/src/config-schema.ts @@ -4,7 +4,7 @@ import { GroupPolicySchema, MarkdownConfigSchema, requireOpenAllowFrom, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { z } from "zod"; import { buildSecretInputSchema } from "./secret-input.js"; diff --git a/extensions/mattermost/src/group-mentions.ts b/extensions/mattermost/src/group-mentions.ts index c92da2000c0..6f57c8f7970 100644 --- a/extensions/mattermost/src/group-mentions.ts +++ b/extensions/mattermost/src/group-mentions.ts @@ -1,4 +1,4 @@ -import type { ChannelGroupContext } from "openclaw/plugin-sdk"; +import type { ChannelGroupContext } from "openclaw/plugin-sdk/compat"; import { resolveMattermostAccount } from "./mattermost/accounts.js"; export function resolveMattermostGroupRequireMention( diff --git a/extensions/mattermost/src/mattermost/accounts.test.ts b/extensions/mattermost/src/mattermost/accounts.test.ts index 2fd6b253163..29011495398 100644 --- a/extensions/mattermost/src/mattermost/accounts.test.ts +++ b/extensions/mattermost/src/mattermost/accounts.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import { resolveDefaultMattermostAccountId } from "./accounts.js"; diff --git a/extensions/mattermost/src/mattermost/accounts.ts b/extensions/mattermost/src/mattermost/accounts.ts index ca120d08c6b..521bab481df 100644 --- a/extensions/mattermost/src/mattermost/accounts.ts +++ b/extensions/mattermost/src/mattermost/accounts.ts @@ -1,9 +1,9 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; import { DEFAULT_ACCOUNT_ID, normalizeAccountId, normalizeOptionalAccountId, } from "openclaw/plugin-sdk/account-id"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "../secret-input.js"; import type { MattermostAccountConfig, MattermostChatMode } from "../types.js"; import { normalizeMattermostBaseUrl } from "./client.js"; diff --git a/extensions/mattermost/src/mattermost/monitor-auth.ts b/extensions/mattermost/src/mattermost/monitor-auth.ts index 2b968c5f117..edf945dbd16 100644 --- a/extensions/mattermost/src/mattermost/monitor-auth.ts +++ b/extensions/mattermost/src/mattermost/monitor-auth.ts @@ -1,4 +1,7 @@ -import { resolveAllowlistMatchSimple, resolveEffectiveAllowFromLists } from "openclaw/plugin-sdk"; +import { + resolveAllowlistMatchSimple, + resolveEffectiveAllowFromLists, +} from "openclaw/plugin-sdk/compat"; export function normalizeMattermostAllowEntry(entry: string): string { const trimmed = entry.trim(); diff --git a/extensions/mattermost/src/mattermost/monitor-helpers.ts b/extensions/mattermost/src/mattermost/monitor-helpers.ts index d645d563d38..74d6f7689df 100644 --- a/extensions/mattermost/src/mattermost/monitor-helpers.ts +++ b/extensions/mattermost/src/mattermost/monitor-helpers.ts @@ -2,8 +2,8 @@ import { formatInboundFromLabel as formatInboundFromLabelShared, resolveThreadSessionKeys as resolveThreadSessionKeysShared, type OpenClawConfig, -} from "openclaw/plugin-sdk"; -export { createDedupeCache, rawDataToString } from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; +export { createDedupeCache, rawDataToString } from "openclaw/plugin-sdk/compat"; export type ResponsePrefixContext = { model?: string; diff --git a/extensions/mattermost/src/mattermost/monitor-websocket.test.ts b/extensions/mattermost/src/mattermost/monitor-websocket.test.ts index 8311092ff94..02b9f6a2742 100644 --- a/extensions/mattermost/src/mattermost/monitor-websocket.test.ts +++ b/extensions/mattermost/src/mattermost/monitor-websocket.test.ts @@ -1,4 +1,4 @@ -import type { RuntimeEnv } from "openclaw/plugin-sdk"; +import type { RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { describe, expect, it, vi } from "vitest"; import { createMattermostConnectOnce, diff --git a/extensions/mattermost/src/mattermost/monitor-websocket.ts b/extensions/mattermost/src/mattermost/monitor-websocket.ts index 19494c1a01b..cfe5ab96fdc 100644 --- a/extensions/mattermost/src/mattermost/monitor-websocket.ts +++ b/extensions/mattermost/src/mattermost/monitor-websocket.ts @@ -1,4 +1,4 @@ -import type { ChannelAccountSnapshot, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { ChannelAccountSnapshot, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import WebSocket from "ws"; import type { MattermostPost } from "./client.js"; import { rawDataToString } from "./monitor-helpers.js"; diff --git a/extensions/mattermost/src/mattermost/monitor.authz.test.ts b/extensions/mattermost/src/mattermost/monitor.authz.test.ts index 9b6a296a34e..9ee7071dac5 100644 --- a/extensions/mattermost/src/mattermost/monitor.authz.test.ts +++ b/extensions/mattermost/src/mattermost/monitor.authz.test.ts @@ -1,4 +1,4 @@ -import { resolveControlCommandGate } from "openclaw/plugin-sdk"; +import { resolveControlCommandGate } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import { resolveMattermostEffectiveAllowFromLists } from "./monitor-auth.js"; diff --git a/extensions/mattermost/src/mattermost/monitor.ts b/extensions/mattermost/src/mattermost/monitor.ts index 6ad677cf131..d62ddd80896 100644 --- a/extensions/mattermost/src/mattermost/monitor.ts +++ b/extensions/mattermost/src/mattermost/monitor.ts @@ -4,7 +4,7 @@ import type { OpenClawConfig, ReplyPayload, RuntimeEnv, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { buildAgentMediaPayload, DM_GROUP_ACCESS_REASON, @@ -27,7 +27,7 @@ import { warnMissingProviderGroupPolicyFallbackOnce, listSkillCommandsForAgents, type HistoryEntry, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { getMattermostRuntime } from "../runtime.js"; import { resolveMattermostAccount } from "./accounts.js"; import { diff --git a/extensions/mattermost/src/mattermost/probe.ts b/extensions/mattermost/src/mattermost/probe.ts index eda98b21c0e..f9ec2005af6 100644 --- a/extensions/mattermost/src/mattermost/probe.ts +++ b/extensions/mattermost/src/mattermost/probe.ts @@ -1,4 +1,4 @@ -import type { BaseProbeResult } from "openclaw/plugin-sdk"; +import type { BaseProbeResult } from "openclaw/plugin-sdk/compat"; import { normalizeMattermostBaseUrl, readMattermostError, type MattermostUser } from "./client.js"; export type MattermostProbe = BaseProbeResult & { diff --git a/extensions/mattermost/src/mattermost/reactions.test-helpers.ts b/extensions/mattermost/src/mattermost/reactions.test-helpers.ts index 3556067167f..a19f9b00222 100644 --- a/extensions/mattermost/src/mattermost/reactions.test-helpers.ts +++ b/extensions/mattermost/src/mattermost/reactions.test-helpers.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { expect, vi } from "vitest"; export function createMattermostTestConfig(): OpenClawConfig { diff --git a/extensions/mattermost/src/mattermost/reactions.ts b/extensions/mattermost/src/mattermost/reactions.ts index cc67e639851..7bb3d5eca08 100644 --- a/extensions/mattermost/src/mattermost/reactions.ts +++ b/extensions/mattermost/src/mattermost/reactions.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { resolveMattermostAccount } from "./accounts.js"; import { createMattermostClient, fetchMattermostMe, type MattermostClient } from "./client.js"; diff --git a/extensions/mattermost/src/mattermost/send.ts b/extensions/mattermost/src/mattermost/send.ts index b325895e58d..e7805f39308 100644 --- a/extensions/mattermost/src/mattermost/send.ts +++ b/extensions/mattermost/src/mattermost/send.ts @@ -1,4 +1,4 @@ -import { loadOutboundMediaFromUrl, type OpenClawConfig } from "openclaw/plugin-sdk"; +import { loadOutboundMediaFromUrl, type OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { getMattermostRuntime } from "../runtime.js"; import { resolveMattermostAccount } from "./accounts.js"; import { diff --git a/extensions/mattermost/src/mattermost/slash-http.test.ts b/extensions/mattermost/src/mattermost/slash-http.test.ts index c4469b9cad9..7592de3c4dd 100644 --- a/extensions/mattermost/src/mattermost/slash-http.test.ts +++ b/extensions/mattermost/src/mattermost/slash-http.test.ts @@ -1,6 +1,6 @@ import type { IncomingMessage, ServerResponse } from "node:http"; import { PassThrough } from "node:stream"; -import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import type { ResolvedMattermostAccount } from "./accounts.js"; import { createSlashCommandHttpHandler } from "./slash-http.js"; diff --git a/extensions/mattermost/src/mattermost/slash-http.ts b/extensions/mattermost/src/mattermost/slash-http.ts index a454b5c670a..49f0e89c1ea 100644 --- a/extensions/mattermost/src/mattermost/slash-http.ts +++ b/extensions/mattermost/src/mattermost/slash-http.ts @@ -6,14 +6,14 @@ */ import type { IncomingMessage, ServerResponse } from "node:http"; -import type { OpenClawConfig, ReplyPayload, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, ReplyPayload, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { createReplyPrefixOptions, createTypingCallbacks, isDangerousNameMatchingEnabled, logTypingFailure, resolveControlCommandGate, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import type { ResolvedMattermostAccount } from "../mattermost/accounts.js"; import { getMattermostRuntime } from "../runtime.js"; import { diff --git a/extensions/mattermost/src/mattermost/slash-state.ts b/extensions/mattermost/src/mattermost/slash-state.ts index 26a2ed029c6..2ecf9eba2bf 100644 --- a/extensions/mattermost/src/mattermost/slash-state.ts +++ b/extensions/mattermost/src/mattermost/slash-state.ts @@ -10,7 +10,7 @@ */ import type { IncomingMessage, ServerResponse } from "node:http"; -import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; +import type { OpenClawPluginApi } from "openclaw/plugin-sdk/compat"; import type { ResolvedMattermostAccount } from "./accounts.js"; import { resolveSlashCommandConfig, type MattermostRegisteredCommand } from "./slash-commands.js"; import { createSlashCommandHttpHandler } from "./slash-http.js"; @@ -86,8 +86,8 @@ export function activateSlashCommands(params: { registeredCommands: MattermostRegisteredCommand[]; triggerMap?: Map; api: { - cfg: import("openclaw/plugin-sdk").OpenClawConfig; - runtime: import("openclaw/plugin-sdk").RuntimeEnv; + cfg: import("openclaw/plugin-sdk/compat").OpenClawConfig; + runtime: import("openclaw/plugin-sdk/compat").RuntimeEnv; }; log?: (msg: string) => void; }) { diff --git a/extensions/mattermost/src/onboarding-helpers.ts b/extensions/mattermost/src/onboarding-helpers.ts index 796de0f1cb1..f3797c608ad 100644 --- a/extensions/mattermost/src/onboarding-helpers.ts +++ b/extensions/mattermost/src/onboarding-helpers.ts @@ -1 +1 @@ -export { promptAccountId } from "openclaw/plugin-sdk"; +export { promptAccountId } from "openclaw/plugin-sdk/compat"; diff --git a/extensions/mattermost/src/onboarding.status.test.ts b/extensions/mattermost/src/onboarding.status.test.ts index 03cb2844782..fa1cc13c382 100644 --- a/extensions/mattermost/src/onboarding.status.test.ts +++ b/extensions/mattermost/src/onboarding.status.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import { mattermostOnboardingAdapter } from "./onboarding.js"; diff --git a/extensions/mattermost/src/onboarding.ts b/extensions/mattermost/src/onboarding.ts index a76145213e4..c1f01b4622c 100644 --- a/extensions/mattermost/src/onboarding.ts +++ b/extensions/mattermost/src/onboarding.ts @@ -1,3 +1,4 @@ +import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; import { hasConfiguredSecretInput, promptSingleChannelSecretInput, @@ -5,8 +6,7 @@ import { type OpenClawConfig, type SecretInput, type WizardPrompter, -} from "openclaw/plugin-sdk"; -import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id"; +} from "openclaw/plugin-sdk/compat"; import { listMattermostAccountIds, resolveDefaultMattermostAccountId, diff --git a/extensions/mattermost/src/runtime.ts b/extensions/mattermost/src/runtime.ts index 10ae1698a05..e2cb807f30f 100644 --- a/extensions/mattermost/src/runtime.ts +++ b/extensions/mattermost/src/runtime.ts @@ -1,4 +1,4 @@ -import type { PluginRuntime } from "openclaw/plugin-sdk"; +import type { PluginRuntime } from "openclaw/plugin-sdk/compat"; let runtime: PluginRuntime | null = null; diff --git a/extensions/mattermost/src/secret-input.ts b/extensions/mattermost/src/secret-input.ts index f90d41c6fb9..3fc82b3ac91 100644 --- a/extensions/mattermost/src/secret-input.ts +++ b/extensions/mattermost/src/secret-input.ts @@ -2,7 +2,7 @@ import { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { z } from "zod"; export { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString }; diff --git a/extensions/mattermost/src/types.ts b/extensions/mattermost/src/types.ts index f141695ff73..d2b50e3a510 100644 --- a/extensions/mattermost/src/types.ts +++ b/extensions/mattermost/src/types.ts @@ -3,7 +3,7 @@ import type { DmPolicy, GroupPolicy, SecretInput, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; export type MattermostChatMode = "oncall" | "onmessage" | "onchar";