mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:10:44 +00:00
Plugins: internalize msteams SDK imports
This commit is contained in:
1
extensions/msteams/runtime-api.ts
Normal file
1
extensions/msteams/runtime-api.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "openclaw/plugin-sdk/msteams";
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fetchWithSsrFGuard, type SsrFPolicy } from "openclaw/plugin-sdk/msteams";
|
||||
import { fetchWithSsrFGuard, type SsrFPolicy } from "../../runtime-api.js";
|
||||
import { getMSTeamsRuntime } from "../runtime.js";
|
||||
import { downloadMSTeamsAttachments } from "./download.js";
|
||||
import { downloadAndStoreMSTeamsRemoteMedia } from "./remote-media.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { buildMediaPayload } from "openclaw/plugin-sdk/msteams";
|
||||
import { buildMediaPayload } from "../../runtime-api.js";
|
||||
|
||||
export function buildMSTeamsMediaPayload(
|
||||
mediaList: Array<{ path: string; contentType?: string }>,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk/msteams";
|
||||
import type { SsrFPolicy } from "../../runtime-api.js";
|
||||
import { getMSTeamsRuntime } from "../runtime.js";
|
||||
import { inferPlaceholder } from "./shared.js";
|
||||
import type { MSTeamsInboundMedia } from "./types.js";
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
isHttpsUrlAllowedByHostnameSuffixAllowlist,
|
||||
isPrivateIpAddress,
|
||||
normalizeHostnameSuffixAllowlist,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk/msteams";
|
||||
} from "../../runtime-api.js";
|
||||
import type { SsrFPolicy } from "../../runtime-api.js";
|
||||
import type { MSTeamsAttachmentLike } from "./types.js";
|
||||
|
||||
type InlineImageCandidate =
|
||||
|
||||
@@ -6,11 +6,7 @@ import type {
|
||||
ChannelMessageToolDiscovery,
|
||||
} from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
||||
import type {
|
||||
ChannelMessageActionName,
|
||||
ChannelPlugin,
|
||||
OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
import type { ChannelMessageActionName, ChannelPlugin, OpenClawConfig } from "../runtime-api.js";
|
||||
import {
|
||||
buildProbeChannelStatusSummary,
|
||||
buildRuntimeAccountStatusSnapshot,
|
||||
@@ -19,7 +15,7 @@ import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
MSTeamsConfigSchema,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import { resolveMSTeamsGroupToolPolicy } from "./policy.js";
|
||||
import type { ProbeMSTeamsResult } from "./probe.js";
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk/msteams";
|
||||
import type { ChannelDirectoryEntry } from "../runtime-api.js";
|
||||
import { searchGraphUsers } from "./graph-users.js";
|
||||
import {
|
||||
type GraphChannel,
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { withFileLock } from "openclaw/plugin-sdk/msteams";
|
||||
export { withFileLock } from "../runtime-api.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/msteams";
|
||||
import type { MSTeamsConfig } from "../runtime-api.js";
|
||||
import { GRAPH_ROOT } from "./attachments/shared.js";
|
||||
import { loadMSTeamsSdkWithAuth } from "./sdk.js";
|
||||
import { readAccessToken } from "./token-response.js";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
extensionForMime,
|
||||
extractOriginalFilename,
|
||||
getFileExtension,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
|
||||
/**
|
||||
* Detect MIME type from URL extension or data URL.
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type ReplyPayload,
|
||||
SILENT_REPLY_TOKEN,
|
||||
sleep,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import type { StoredConversationReference } from "./conversation-store.js";
|
||||
import { classifyMSTeamsSendError } from "./errors.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/msteams";
|
||||
import type { OpenClawConfig, RuntimeEnv } from "../runtime-api.js";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import { buildFileInfoCard, parseFileConsentInvoke, uploadToConsentUrl } from "./file-consent.js";
|
||||
import { normalizeMSTeamsConversationId } from "./inbound.js";
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
resolveEffectiveAllowFromLists,
|
||||
resolveDmGroupAccessWithLists,
|
||||
type HistoryEntry,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../../runtime-api.js";
|
||||
import {
|
||||
buildMSTeamsAttachmentPlaceholder,
|
||||
buildMSTeamsMediaPayload,
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
summarizeMapping,
|
||||
type OpenClawConfig,
|
||||
type RuntimeEnv,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import { formatUnknownError } from "./errors.js";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/msteams";
|
||||
import type { ChannelOutboundAdapter } from "../runtime-api.js";
|
||||
import { createMSTeamsPollStoreFs } from "./polls.js";
|
||||
import { getMSTeamsRuntime } from "./runtime.js";
|
||||
import { sendMessageMSTeams, sendPollMSTeams } from "./send.js";
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
MSTeamsConfig,
|
||||
MSTeamsReplyStyle,
|
||||
MSTeamsTeamConfig,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import {
|
||||
buildChannelKeyCandidates,
|
||||
evaluateSenderGroupAccessForPolicy,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
resolveChannelEntryMatchWithFallback,
|
||||
resolveNestedAllowlistDecision,
|
||||
isDangerousNameMatchingEnabled,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
|
||||
export type MSTeamsResolvedRouteConfig = {
|
||||
teamConfig?: MSTeamsTeamConfig;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
normalizeStringEntries,
|
||||
type BaseProbeResult,
|
||||
type MSTeamsConfig,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import { formatUnknownError } from "./errors.js";
|
||||
import { loadMSTeamsSdkWithAuth } from "./sdk.js";
|
||||
import { readAccessToken } from "./token-response.js";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
type OpenClawConfig,
|
||||
type MSTeamsReplyStyle,
|
||||
type RuntimeEnv,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import type { StoredConversationReference } from "./conversation-store.js";
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/msteams";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
import type { PluginRuntime } from "../runtime-api.js";
|
||||
|
||||
const { setRuntime: setMSTeamsRuntime, getRuntime: getMSTeamsRuntime } =
|
||||
createPluginRuntimeStore<PluginRuntime>("MSTeams runtime not initialized");
|
||||
|
||||
@@ -2,6 +2,6 @@ import {
|
||||
hasConfiguredSecretInput,
|
||||
normalizeResolvedSecretInputString,
|
||||
normalizeSecretInputString,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
|
||||
export { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString };
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
resolveChannelMediaMaxBytes,
|
||||
type OpenClawConfig,
|
||||
type PluginRuntime,
|
||||
} from "openclaw/plugin-sdk/msteams";
|
||||
} from "../runtime-api.js";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import type {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/msteams";
|
||||
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/msteams";
|
||||
import type { OpenClawConfig } from "../runtime-api.js";
|
||||
import { loadOutboundMediaFromUrl } from "../runtime-api.js";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import {
|
||||
classifyMSTeamsSendError,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { MSTeamsTeamConfig } from "openclaw/plugin-sdk/msteams";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatDocsLink,
|
||||
@@ -13,6 +12,7 @@ import {
|
||||
type OpenClawConfig,
|
||||
type WizardPrompter,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import type { MSTeamsTeamConfig } from "../runtime-api.js";
|
||||
import {
|
||||
parseMSTeamsTeamEntry,
|
||||
resolveMSTeamsChannelAllowlist,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from "node:fs";
|
||||
import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/msteams";
|
||||
import { readJsonFileWithFallback, writeJsonFileAtomically } from "../runtime-api.js";
|
||||
import { withFileLock as withPathLock } from "./file-lock.js";
|
||||
|
||||
const STORE_LOCK_OPTIONS = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/msteams";
|
||||
import type { MSTeamsConfig } from "../runtime-api.js";
|
||||
import {
|
||||
hasConfiguredSecretInput,
|
||||
normalizeResolvedSecretInputString,
|
||||
|
||||
Reference in New Issue
Block a user