From 10bd6ae3c8e110027208aa3ff0b1d6d0b5363afb Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Wed, 4 Mar 2026 01:20:12 -0500 Subject: [PATCH] Extensions: migrate msteams plugin-sdk imports --- extensions/msteams/src/attachments.test.ts | 2 +- extensions/msteams/src/attachments/graph.ts | 2 +- extensions/msteams/src/attachments/payload.ts | 2 +- extensions/msteams/src/attachments/remote-media.ts | 2 +- extensions/msteams/src/attachments/shared.ts | 4 ++-- extensions/msteams/src/channel.directory.test.ts | 2 +- extensions/msteams/src/channel.ts | 8 ++++++-- extensions/msteams/src/directory-live.ts | 2 +- extensions/msteams/src/file-lock.ts | 2 +- extensions/msteams/src/graph.ts | 2 +- extensions/msteams/src/media-helpers.ts | 2 +- extensions/msteams/src/messenger.test.ts | 2 +- extensions/msteams/src/messenger.ts | 2 +- .../msteams/src/monitor-handler.file-consent.test.ts | 2 +- extensions/msteams/src/monitor-handler.ts | 2 +- .../src/monitor-handler/message-handler.authz.test.ts | 2 +- extensions/msteams/src/monitor-handler/message-handler.ts | 2 +- extensions/msteams/src/monitor.lifecycle.test.ts | 2 +- extensions/msteams/src/monitor.ts | 2 +- extensions/msteams/src/onboarding.ts | 4 ++-- extensions/msteams/src/outbound.ts | 2 +- extensions/msteams/src/policy.test.ts | 2 +- extensions/msteams/src/policy.ts | 4 ++-- extensions/msteams/src/probe.test.ts | 2 +- extensions/msteams/src/probe.ts | 2 +- extensions/msteams/src/reply-dispatcher.ts | 2 +- extensions/msteams/src/runtime.ts | 2 +- extensions/msteams/src/secret-input.ts | 2 +- extensions/msteams/src/send-context.ts | 2 +- extensions/msteams/src/send.test.ts | 2 +- extensions/msteams/src/send.ts | 4 ++-- extensions/msteams/src/store-fs.ts | 2 +- extensions/msteams/src/test-runtime.ts | 2 +- extensions/msteams/src/token.ts | 2 +- 34 files changed, 43 insertions(+), 39 deletions(-) diff --git a/extensions/msteams/src/attachments.test.ts b/extensions/msteams/src/attachments.test.ts index 97ace8819c9..9f0de10992f 100644 --- a/extensions/msteams/src/attachments.test.ts +++ b/extensions/msteams/src/attachments.test.ts @@ -1,4 +1,4 @@ -import type { PluginRuntime, SsrFPolicy } from "openclaw/plugin-sdk"; +import type { PluginRuntime, SsrFPolicy } from "openclaw/plugin-sdk/compat"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { createPluginRuntimeMock } from "../../test-utils/plugin-runtime-mock.js"; import { diff --git a/extensions/msteams/src/attachments/graph.ts b/extensions/msteams/src/attachments/graph.ts index a50356e3ced..c9f632c7f38 100644 --- a/extensions/msteams/src/attachments/graph.ts +++ b/extensions/msteams/src/attachments/graph.ts @@ -1,4 +1,4 @@ -import { fetchWithSsrFGuard, type SsrFPolicy } from "openclaw/plugin-sdk"; +import { fetchWithSsrFGuard, type SsrFPolicy } from "openclaw/plugin-sdk/compat"; import { getMSTeamsRuntime } from "../runtime.js"; import { downloadMSTeamsAttachments } from "./download.js"; import { downloadAndStoreMSTeamsRemoteMedia } from "./remote-media.js"; diff --git a/extensions/msteams/src/attachments/payload.ts b/extensions/msteams/src/attachments/payload.ts index 2049609d894..2134a382f0c 100644 --- a/extensions/msteams/src/attachments/payload.ts +++ b/extensions/msteams/src/attachments/payload.ts @@ -1,4 +1,4 @@ -import { buildMediaPayload } from "openclaw/plugin-sdk"; +import { buildMediaPayload } from "openclaw/plugin-sdk/compat"; export function buildMSTeamsMediaPayload( mediaList: Array<{ path: string; contentType?: string }>, diff --git a/extensions/msteams/src/attachments/remote-media.ts b/extensions/msteams/src/attachments/remote-media.ts index 162a797b57f..b31b47723b9 100644 --- a/extensions/msteams/src/attachments/remote-media.ts +++ b/extensions/msteams/src/attachments/remote-media.ts @@ -1,4 +1,4 @@ -import type { SsrFPolicy } from "openclaw/plugin-sdk"; +import type { SsrFPolicy } from "openclaw/plugin-sdk/compat"; import { getMSTeamsRuntime } from "../runtime.js"; import { inferPlaceholder } from "./shared.js"; import type { MSTeamsInboundMedia } from "./types.js"; diff --git a/extensions/msteams/src/attachments/shared.ts b/extensions/msteams/src/attachments/shared.ts index 7897b52803e..3222be248bc 100644 --- a/extensions/msteams/src/attachments/shared.ts +++ b/extensions/msteams/src/attachments/shared.ts @@ -4,8 +4,8 @@ import { isHttpsUrlAllowedByHostnameSuffixAllowlist, isPrivateIpAddress, normalizeHostnameSuffixAllowlist, -} from "openclaw/plugin-sdk"; -import type { SsrFPolicy } from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; +import type { SsrFPolicy } from "openclaw/plugin-sdk/compat"; import type { MSTeamsAttachmentLike } from "./types.js"; type InlineImageCandidate = diff --git a/extensions/msteams/src/channel.directory.test.ts b/extensions/msteams/src/channel.directory.test.ts index 26a9bec2f5d..97bfd227f5f 100644 --- a/extensions/msteams/src/channel.directory.test.ts +++ b/extensions/msteams/src/channel.directory.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import { msteamsPlugin } from "./channel.js"; diff --git a/extensions/msteams/src/channel.ts b/extensions/msteams/src/channel.ts index 16c7ad0fb49..057f37c83a4 100644 --- a/extensions/msteams/src/channel.ts +++ b/extensions/msteams/src/channel.ts @@ -1,4 +1,8 @@ -import type { ChannelMessageActionName, ChannelPlugin, OpenClawConfig } from "openclaw/plugin-sdk"; +import type { + ChannelMessageActionName, + ChannelPlugin, + OpenClawConfig, +} from "openclaw/plugin-sdk/compat"; import { buildBaseChannelStatusSummary, buildChannelConfigSchema, @@ -8,7 +12,7 @@ import { PAIRING_APPROVED_MESSAGE, resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { listMSTeamsDirectoryGroupsLive, listMSTeamsDirectoryPeersLive } from "./directory-live.js"; import { msteamsOnboardingAdapter } from "./onboarding.js"; import { msteamsOutbound } from "./outbound.js"; diff --git a/extensions/msteams/src/directory-live.ts b/extensions/msteams/src/directory-live.ts index 06b2485eb3b..0e2464aa0ce 100644 --- a/extensions/msteams/src/directory-live.ts +++ b/extensions/msteams/src/directory-live.ts @@ -1,4 +1,4 @@ -import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk"; +import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk/compat"; import { searchGraphUsers } from "./graph-users.js"; import { type GraphChannel, diff --git a/extensions/msteams/src/file-lock.ts b/extensions/msteams/src/file-lock.ts index 02bf9aa5b43..9c5782b9ff5 100644 --- a/extensions/msteams/src/file-lock.ts +++ b/extensions/msteams/src/file-lock.ts @@ -1 +1 @@ -export { withFileLock } from "openclaw/plugin-sdk"; +export { withFileLock } from "openclaw/plugin-sdk/compat"; diff --git a/extensions/msteams/src/graph.ts b/extensions/msteams/src/graph.ts index d2c21015361..983bfe9ed64 100644 --- a/extensions/msteams/src/graph.ts +++ b/extensions/msteams/src/graph.ts @@ -1,4 +1,4 @@ -import type { MSTeamsConfig } from "openclaw/plugin-sdk"; +import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat"; import { GRAPH_ROOT } from "./attachments/shared.js"; import { loadMSTeamsSdkWithAuth } from "./sdk.js"; import { readAccessToken } from "./token-response.js"; diff --git a/extensions/msteams/src/media-helpers.ts b/extensions/msteams/src/media-helpers.ts index bfe113d40e9..f8a36e55f81 100644 --- a/extensions/msteams/src/media-helpers.ts +++ b/extensions/msteams/src/media-helpers.ts @@ -8,7 +8,7 @@ import { extensionForMime, extractOriginalFilename, getFileExtension, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; /** * Detect MIME type from URL extension or data URL. diff --git a/extensions/msteams/src/messenger.test.ts b/extensions/msteams/src/messenger.test.ts index 0857f8d5c3f..973bbb67973 100644 --- a/extensions/msteams/src/messenger.test.ts +++ b/extensions/msteams/src/messenger.test.ts @@ -1,7 +1,7 @@ import { mkdtemp, rm, writeFile } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; -import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk"; +import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk/compat"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { createPluginRuntimeMock } from "../../test-utils/plugin-runtime-mock.js"; import type { StoredConversationReference } from "./conversation-store.js"; diff --git a/extensions/msteams/src/messenger.ts b/extensions/msteams/src/messenger.ts index 4a913192944..c412c47d048 100644 --- a/extensions/msteams/src/messenger.ts +++ b/extensions/msteams/src/messenger.ts @@ -7,7 +7,7 @@ import { type ReplyPayload, SILENT_REPLY_TOKEN, sleep, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import type { MSTeamsAccessTokenProvider } from "./attachments/types.js"; import type { StoredConversationReference } from "./conversation-store.js"; import { classifyMSTeamsSendError } from "./errors.js"; diff --git a/extensions/msteams/src/monitor-handler.file-consent.test.ts b/extensions/msteams/src/monitor-handler.file-consent.test.ts index 386ffc34853..8288668ba67 100644 --- a/extensions/msteams/src/monitor-handler.file-consent.test.ts +++ b/extensions/msteams/src/monitor-handler.file-consent.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { beforeEach, describe, expect, it, vi } from "vitest"; import type { MSTeamsConversationStore } from "./conversation-store.js"; import type { MSTeamsAdapter } from "./messenger.js"; diff --git a/extensions/msteams/src/monitor-handler.ts b/extensions/msteams/src/monitor-handler.ts index ac1b469e8be..b64fdee6d67 100644 --- a/extensions/msteams/src/monitor-handler.ts +++ b/extensions/msteams/src/monitor-handler.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import type { MSTeamsConversationStore } from "./conversation-store.js"; import { buildFileInfoCard, parseFileConsentInvoke, uploadToConsentUrl } from "./file-consent.js"; import { normalizeMSTeamsConversationId } from "./inbound.js"; diff --git a/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts b/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts index 2be36f89732..7e8118b5629 100644 --- a/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts +++ b/extensions/msteams/src/monitor-handler/message-handler.authz.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { describe, expect, it, vi } from "vitest"; import type { MSTeamsMessageHandlerDeps } from "../monitor-handler.js"; import { setMSTeamsRuntime } from "../runtime.js"; diff --git a/extensions/msteams/src/monitor-handler/message-handler.ts b/extensions/msteams/src/monitor-handler/message-handler.ts index a85e06348b0..0bdb9142641 100644 --- a/extensions/msteams/src/monitor-handler/message-handler.ts +++ b/extensions/msteams/src/monitor-handler/message-handler.ts @@ -15,7 +15,7 @@ import { resolveEffectiveAllowFromLists, resolveDmGroupAccessWithLists, type HistoryEntry, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { buildMSTeamsAttachmentPlaceholder, buildMSTeamsMediaPayload, diff --git a/extensions/msteams/src/monitor.lifecycle.test.ts b/extensions/msteams/src/monitor.lifecycle.test.ts index 980b0871bc5..560b2839efe 100644 --- a/extensions/msteams/src/monitor.lifecycle.test.ts +++ b/extensions/msteams/src/monitor.lifecycle.test.ts @@ -1,5 +1,5 @@ import { EventEmitter } from "node:events"; -import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk"; +import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat"; import { afterEach, describe, expect, it, vi } from "vitest"; import type { MSTeamsConversationStore } from "./conversation-store.js"; import type { MSTeamsPollStore } from "./polls.js"; diff --git a/extensions/msteams/src/monitor.ts b/extensions/msteams/src/monitor.ts index f2adba52139..432af67ad8d 100644 --- a/extensions/msteams/src/monitor.ts +++ b/extensions/msteams/src/monitor.ts @@ -7,7 +7,7 @@ import { summarizeMapping, type OpenClawConfig, type RuntimeEnv, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js"; import type { MSTeamsConversationStore } from "./conversation-store.js"; import { formatUnknownError } from "./errors.js"; diff --git a/extensions/msteams/src/onboarding.ts b/extensions/msteams/src/onboarding.ts index c40d88b2bc4..e5836cc73e6 100644 --- a/extensions/msteams/src/onboarding.ts +++ b/extensions/msteams/src/onboarding.ts @@ -5,14 +5,14 @@ import type { DmPolicy, WizardPrompter, MSTeamsTeamConfig, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { addWildcardAllowFrom, DEFAULT_ACCOUNT_ID, formatDocsLink, mergeAllowFromEntries, promptChannelAccessConfig, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { parseMSTeamsTeamEntry, resolveMSTeamsChannelAllowlist, diff --git a/extensions/msteams/src/outbound.ts b/extensions/msteams/src/outbound.ts index 3a401f13d9c..ca2edc3985f 100644 --- a/extensions/msteams/src/outbound.ts +++ b/extensions/msteams/src/outbound.ts @@ -1,4 +1,4 @@ -import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk"; +import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/compat"; import { createMSTeamsPollStoreFs } from "./polls.js"; import { getMSTeamsRuntime } from "./runtime.js"; import { sendMessageMSTeams, sendPollMSTeams } from "./send.js"; diff --git a/extensions/msteams/src/policy.test.ts b/extensions/msteams/src/policy.test.ts index 3c7daa58b3f..81582cb857a 100644 --- a/extensions/msteams/src/policy.test.ts +++ b/extensions/msteams/src/policy.test.ts @@ -1,4 +1,4 @@ -import type { MSTeamsConfig } from "openclaw/plugin-sdk"; +import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat"; import { describe, expect, it } from "vitest"; import { isMSTeamsGroupAllowed, diff --git a/extensions/msteams/src/policy.ts b/extensions/msteams/src/policy.ts index a3545c0594f..c55a8433b17 100644 --- a/extensions/msteams/src/policy.ts +++ b/extensions/msteams/src/policy.ts @@ -7,7 +7,7 @@ import type { MSTeamsConfig, MSTeamsReplyStyle, MSTeamsTeamConfig, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import { buildChannelKeyCandidates, normalizeChannelSlug, @@ -15,7 +15,7 @@ import { resolveToolsBySender, resolveChannelEntryMatchWithFallback, resolveNestedAllowlistDecision, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; export type MSTeamsResolvedRouteConfig = { teamConfig?: MSTeamsTeamConfig; diff --git a/extensions/msteams/src/probe.test.ts b/extensions/msteams/src/probe.test.ts index b9c18019ac5..9ab758b2709 100644 --- a/extensions/msteams/src/probe.test.ts +++ b/extensions/msteams/src/probe.test.ts @@ -1,4 +1,4 @@ -import type { MSTeamsConfig } from "openclaw/plugin-sdk"; +import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat"; import { describe, expect, it, vi } from "vitest"; const hostMockState = vi.hoisted(() => ({ diff --git a/extensions/msteams/src/probe.ts b/extensions/msteams/src/probe.ts index 8434fa50416..46dd2747785 100644 --- a/extensions/msteams/src/probe.ts +++ b/extensions/msteams/src/probe.ts @@ -1,4 +1,4 @@ -import type { BaseProbeResult, MSTeamsConfig } from "openclaw/plugin-sdk"; +import type { BaseProbeResult, MSTeamsConfig } from "openclaw/plugin-sdk/compat"; import { formatUnknownError } from "./errors.js"; import { loadMSTeamsSdkWithAuth } from "./sdk.js"; import { readAccessToken } from "./token-response.js"; diff --git a/extensions/msteams/src/reply-dispatcher.ts b/extensions/msteams/src/reply-dispatcher.ts index 3ddf7b18c5e..e940fd23738 100644 --- a/extensions/msteams/src/reply-dispatcher.ts +++ b/extensions/msteams/src/reply-dispatcher.ts @@ -6,7 +6,7 @@ import { type OpenClawConfig, type MSTeamsReplyStyle, type RuntimeEnv, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import type { MSTeamsAccessTokenProvider } from "./attachments/types.js"; import type { StoredConversationReference } from "./conversation-store.js"; import { diff --git a/extensions/msteams/src/runtime.ts b/extensions/msteams/src/runtime.ts index deb09f3ebc8..86c8f9a34a3 100644 --- a/extensions/msteams/src/runtime.ts +++ b/extensions/msteams/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/msteams/src/secret-input.ts b/extensions/msteams/src/secret-input.ts index 0e24edc05b3..fc64ca00fd1 100644 --- a/extensions/msteams/src/secret-input.ts +++ b/extensions/msteams/src/secret-input.ts @@ -2,6 +2,6 @@ import { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; export { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString }; diff --git a/extensions/msteams/src/send-context.ts b/extensions/msteams/src/send-context.ts index af617a7150f..389aed43b91 100644 --- a/extensions/msteams/src/send-context.ts +++ b/extensions/msteams/src/send-context.ts @@ -2,7 +2,7 @@ import { resolveChannelMediaMaxBytes, type OpenClawConfig, type PluginRuntime, -} from "openclaw/plugin-sdk"; +} from "openclaw/plugin-sdk/compat"; import type { MSTeamsAccessTokenProvider } from "./attachments/types.js"; import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js"; import type { diff --git a/extensions/msteams/src/send.test.ts b/extensions/msteams/src/send.test.ts index cbab8459dd9..3c826310c58 100644 --- a/extensions/msteams/src/send.test.ts +++ b/extensions/msteams/src/send.test.ts @@ -1,4 +1,4 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { sendMessageMSTeams } from "./send.js"; diff --git a/extensions/msteams/src/send.ts b/extensions/msteams/src/send.ts index 2ddb12df116..3adb3a1436c 100644 --- a/extensions/msteams/src/send.ts +++ b/extensions/msteams/src/send.ts @@ -1,5 +1,5 @@ -import type { OpenClawConfig } from "openclaw/plugin-sdk"; -import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk"; +import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; +import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/compat"; import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js"; import { classifyMSTeamsSendError, diff --git a/extensions/msteams/src/store-fs.ts b/extensions/msteams/src/store-fs.ts index c13c7dd55e1..c96e96d898c 100644 --- a/extensions/msteams/src/store-fs.ts +++ b/extensions/msteams/src/store-fs.ts @@ -1,5 +1,5 @@ import fs from "node:fs"; -import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk"; +import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/compat"; import { withFileLock as withPathLock } from "./file-lock.js"; const STORE_LOCK_OPTIONS = { diff --git a/extensions/msteams/src/test-runtime.ts b/extensions/msteams/src/test-runtime.ts index e32a8288ac2..6cc4800350a 100644 --- a/extensions/msteams/src/test-runtime.ts +++ b/extensions/msteams/src/test-runtime.ts @@ -1,6 +1,6 @@ import os from "node:os"; import path from "node:path"; -import type { PluginRuntime } from "openclaw/plugin-sdk"; +import type { PluginRuntime } from "openclaw/plugin-sdk/compat"; export const msteamsRuntimeStub = { state: { diff --git a/extensions/msteams/src/token.ts b/extensions/msteams/src/token.ts index c5514699375..862030ba086 100644 --- a/extensions/msteams/src/token.ts +++ b/extensions/msteams/src/token.ts @@ -1,4 +1,4 @@ -import type { MSTeamsConfig } from "openclaw/plugin-sdk"; +import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat"; import { hasConfiguredSecretInput, normalizeResolvedSecretInputString,