@openclaw/msteams 2026.5.31-beta.3 → 2026.5.31-beta.4

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.
package/dist/api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { i as msteamsSetupAdapter, n as openDelegatedOAuthUrl, r as createMSTeamsSetupWizardBase, t as msteamsSetupWizard } from "./setup-surface-B7a1pD-K.js";
2
- import { t as msteamsPlugin } from "./channel-Bl_E7_HN.js";
1
+ import { i as msteamsSetupAdapter, n as openDelegatedOAuthUrl, r as createMSTeamsSetupWizardBase, t as msteamsSetupWizard } from "./setup-surface-DGTz8Mlf.js";
2
+ import { t as msteamsPlugin } from "./channel-Dhw8AvTl.js";
3
3
  export { createMSTeamsSetupWizardBase, msteamsPlugin, msteamsSetupAdapter, msteamsSetupWizard, openDelegatedOAuthUrl };
@@ -1,6 +1,6 @@
1
1
  import { O as resolveNestedAllowlistDecision, S as normalizeChannelSlug, T as resolveChannelEntryMatchWithFallback, _ as isDangerousNameMatchingEnabled, i as buildChannelKeyCandidates, k as resolveToolsBySender, o as buildProbeChannelStatusSummary, r as PAIRING_APPROVED_MESSAGE, s as chunkTextForOutbound, t as DEFAULT_ACCOUNT_ID, u as createDefaultChannelRuntimeState, w as resolveAllowlistMatchSimple } from "./runtime-api-BlvMnDKz.js";
2
2
  import { y as resolveMSTeamsCredentials } from "./errors-Dpn8B05h.js";
3
- import { a as looksLikeMSTeamsTargetId, c as parseMSTeamsConversationId, d as resolveMSTeamsUserAllowlist, i as msteamsSetupAdapter, l as parseMSTeamsTeamChannelInput, o as normalizeMSTeamsMessagingTarget, s as normalizeMSTeamsUserInput, t as msteamsSetupWizard, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-B7a1pD-K.js";
3
+ import { a as looksLikeMSTeamsTargetId, c as parseMSTeamsConversationId, d as resolveMSTeamsUserAllowlist, i as msteamsSetupAdapter, l as parseMSTeamsTeamChannelInput, o as normalizeMSTeamsMessagingTarget, s as normalizeMSTeamsUserInput, t as msteamsSetupWizard, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-DGTz8Mlf.js";
4
4
  import { t as MSTeamsChannelConfigSchema } from "./config-schema-BL4qQZiA.js";
5
5
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
6
6
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
@@ -331,7 +331,7 @@ const collectMSTeamsSecurityWarnings = createAllowlistProviderGroupPolicyWarning
331
331
  resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
332
332
  collect: ({ groupPolicy }) => groupPolicy === "open" ? ["- MS Teams groups: groupPolicy=\"open\" allows any member to trigger (mention-gated). Set channels.msteams.groupPolicy=\"allowlist\" + channels.msteams.groupAllowFrom to restrict senders."] : []
333
333
  });
334
- const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-chO_elmK.js"), "msTeamsChannelRuntime");
334
+ const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-t52N99bX.js"), "msTeamsChannelRuntime");
335
335
  const resolveMSTeamsChannelConfig = (cfg) => ({
336
336
  allowFrom: cfg.channels?.msteams?.allowFrom,
337
337
  defaultTo: cfg.channels?.msteams?.defaultTo
@@ -1117,7 +1117,7 @@ const msteamsPlugin = createChatChannelPlugin({
1117
1117
  })
1118
1118
  }),
1119
1119
  gateway: { startAccount: async (ctx) => {
1120
- const { monitorMSTeamsProvider } = await import("./src-DLpY3asr.js");
1120
+ const { monitorMSTeamsProvider } = await import("./src-DZ76sgTp.js");
1121
1121
  const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
1122
1122
  ctx.setStatus({
1123
1123
  accountId: ctx.accountId,
@@ -1,2 +1,2 @@
1
- import { t as msteamsPlugin } from "./channel-Bl_E7_HN.js";
1
+ import { t as msteamsPlugin } from "./channel-Dhw8AvTl.js";
2
2
  export { msteamsPlugin };
@@ -1,7 +1,7 @@
1
1
  import { C as normalizeStringEntries$1, s as chunkTextForOutbound } from "./runtime-api-BlvMnDKz.js";
2
2
  import { a as searchGraphUsers, c as fetchGraphAbsoluteUrl, d as listTeamsByName, f as normalizeQuery, g as resolveGraphToken, h as postGraphJson, l as fetchGraphJson, m as postGraphBetaJson, o as deleteGraphRequest, p as patchGraphJson, s as escapeOData, u as listChannelsForTeam } from "./errors-Dpn8B05h.js";
3
- import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-Bl_E7_HN.js";
4
- import { S as createMSTeamsConversationStoreState, a as sendMessageMSTeams, b as createMSTeamsPollStoreState, i as sendAdaptiveCardMSTeams, n as deleteMessageMSTeams, o as sendPollMSTeams, r as editMessageMSTeams, t as probeMSTeams } from "./probe-aXL6mfw5.js";
3
+ import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-Dhw8AvTl.js";
4
+ import { S as createMSTeamsConversationStoreState, a as sendMessageMSTeams, b as createMSTeamsPollStoreState, i as sendAdaptiveCardMSTeams, n as deleteMessageMSTeams, o as sendPollMSTeams, r as editMessageMSTeams, t as probeMSTeams } from "./probe-DYb-0Hmx.js";
5
5
  import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
6
6
  import { normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { resolvePayloadMediaUrls, resolveTextChunksWithFallback, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
@@ -61,7 +61,7 @@ async function fileExists(filePath) {
61
61
  }
62
62
  }
63
63
  async function listLegacyLearningFiles(storePath) {
64
- let entries = [];
64
+ let entries;
65
65
  try {
66
66
  entries = await fs.readdir(storePath, { withFileTypes: true });
67
67
  } catch {
@@ -1,7 +1,7 @@
1
1
  import { C as normalizeStringEntries$1, E as resolveChannelMediaMaxBytes, M as getMSTeamsRuntime, d as detectMime, g as getFileExtension, m as extractOriginalFilename, p as extensionForMime, y as loadOutboundMediaFromUrl } from "./runtime-api-BlvMnDKz.js";
2
2
  import { A as isAllowedBotFrameworkServiceUrl, C as readAccessToken, D as buildUserAgent, E as loadMSTeamsSdkWithAuth, N as resolveMSTeamsSdkCloudOptions, P as validateMSTeamsProactiveServiceUrlBoundary, T as createMSTeamsTokenProvider, i as isRevokedProxyError, j as normalizeBotFrameworkServiceUrl, k as describeBotFrameworkServiceUrlHost, n as formatMSTeamsSendErrorHint, r as formatUnknownError, t as classifyMSTeamsSendError, v as loadDelegatedTokens, x as resolveMSTeamsStorePath, y as resolveMSTeamsCredentials } from "./errors-Dpn8B05h.js";
3
3
  import { c as createMSTeamsHttpError } from "./oauth.token-BKzEFepQ.js";
4
- import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-Bl_E7_HN.js";
4
+ import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-Dhw8AvTl.js";
5
5
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
6
6
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
7
7
  import { withFileLock } from "openclaw/plugin-sdk/file-lock";
@@ -1960,8 +1960,7 @@ async function sendMSTeamsMessages(params) {
1960
1960
  const retryOptions = resolveRetryOptions(params.retry);
1961
1961
  const sendWithRetry = async (sendOnce, meta) => {
1962
1962
  if (!retryOptions.enabled) return await sendOnce();
1963
- let attempt = 1;
1964
- while (true) try {
1963
+ for (const attempt of Array.from({ length: retryOptions.maxAttempts }, (_, index) => index + 1)) try {
1965
1964
  return await sendOnce();
1966
1965
  } catch (err) {
1967
1966
  const classification = classifyMSTeamsSendError(err);
@@ -1977,8 +1976,8 @@ async function sendMSTeamsMessages(params) {
1977
1976
  classification
1978
1977
  });
1979
1978
  await sleep(delayMs);
1980
- attempt = nextAttempt;
1981
1979
  }
1980
+ throw new Error("unreachable Teams send retry loop exit");
1982
1981
  };
1983
1982
  const sendMessageInContext = async (sendFn, message, messageIndex) => {
1984
1983
  let pendingUploadId;
@@ -1,5 +1,5 @@
1
1
  import { y as resolveMSTeamsCredentials } from "./errors-Dpn8B05h.js";
2
- import { i as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-B7a1pD-K.js";
2
+ import { i as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-DGTz8Mlf.js";
3
3
  import { t as MSTeamsChannelConfigSchema } from "./config-schema-BL4qQZiA.js";
4
4
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
@@ -494,7 +494,9 @@ const msteamsSetupWizard = {
494
494
  saveDelegatedTokens(await loginMSTeamsDelegated({
495
495
  isRemote: true,
496
496
  openUrl: openDelegatedOAuthUrl,
497
- log: (msg) => params.prompter.note(msg),
497
+ log: (msg) => {
498
+ params.prompter.note(msg);
499
+ },
498
500
  note: (msg, title) => params.prompter.note(msg, title),
499
501
  prompt: (msg) => params.prompter.text({ message: msg }),
500
502
  progress
@@ -1,8 +1,8 @@
1
1
  import { A as summarizeMapping, D as resolveDefaultGroupPolicy, E as resolveChannelMediaMaxBytes, M as getMSTeamsRuntime, N as getOptionalMSTeamsRuntime, _ as isDangerousNameMatchingEnabled, a as buildMediaPayload, b as logTypingFailure, c as createChannelMessageReplyPipeline, f as dispatchReplyFromConfigWithSettledDispatcher$1, l as createChannelPairingController, n as DEFAULT_WEBHOOK_MAX_BODY_BYTES, t as DEFAULT_ACCOUNT_ID, v as keepHttpServerTaskAlive, x as mergeAllowlist } from "./runtime-api-BlvMnDKz.js";
2
2
  import { $ as safeFetchWithPolicy, B as estimateBase64DecodedBytes, E as loadMSTeamsSdkWithAuth, F as ATTACHMENT_TAG_RE, G as isLikelyImageAttachment, H as extractInlineImageCandidates, I as GRAPH_ROOT, J as normalizeContentType, K as isRecord$1, L as IMG_SRC_RE, M as tryNormalizeBotFrameworkServiceUrl, N as resolveMSTeamsSdkCloudOptions, O as ensureUserAgentHeader, Q as resolveRequestUrl, R as applyAuthorizationHeaderForUrl, T as createMSTeamsTokenProvider, U as inferPlaceholder, V as extractHtmlFromAttachment, W as isDownloadableAttachment, X as resolveAttachmentFetchPolicy, Y as readNestedString, Z as resolveMediaSsrfPolicy, et as safeHostForUrl, l as fetchGraphJson, n as formatMSTeamsSendErrorHint, q as isUrlAllowed, r as formatUnknownError, t as classifyMSTeamsSendError, tt as tryBuildGraphSharesUrlForSharedLink, w as createMSTeamsExpressAdapter, x as resolveMSTeamsStorePath, y as resolveMSTeamsCredentials, z as encodeGraphShareId } from "./errors-Dpn8B05h.js";
3
- import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-B7a1pD-K.js";
4
- import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-Bl_E7_HN.js";
5
- import { C as resolveMSTeamsSqliteStateEnv, E as readJsonFile, S as createMSTeamsConversationStoreState, T as withMSTeamsSqliteMutationLock, _ as buildFileInfoCard, b as createMSTeamsPollStoreState, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as sendMSTeamsActivityWithReference, v as parseFileConsentInvoke, w as toPluginJsonValue, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-aXL6mfw5.js";
3
+ import { d as resolveMSTeamsUserAllowlist, u as resolveMSTeamsChannelAllowlist } from "./setup-surface-DGTz8Mlf.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-Dhw8AvTl.js";
5
+ import { C as resolveMSTeamsSqliteStateEnv, E as readJsonFile, S as createMSTeamsConversationStoreState, T as withMSTeamsSqliteMutationLock, _ as buildFileInfoCard, b as createMSTeamsPollStoreState, c as renderReplyPayloadsToMessages, d as withRevokedProxyFallback, f as resolveGraphChatId, g as removePendingUploadFs, h as getPendingUploadFs, l as sendMSTeamsMessages, m as removePendingUpload, p as getPendingUpload, s as buildConversationReference, u as sendMSTeamsActivityWithReference, v as parseFileConsentInvoke, w as toPluginJsonValue, x as extractMSTeamsPollVote, y as uploadToConsentUrl } from "./probe-DYb-0Hmx.js";
6
6
  import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
7
7
  import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelPreviewStreamMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -3974,7 +3974,7 @@ async function monitorMSTeamsProvider(opts) {
3974
3974
  const onError = (err) => {
3975
3975
  httpServer.off("listening", onListening);
3976
3976
  log.error("msteams server error", { error: formatUnknownError(err) });
3977
- reject(err);
3977
+ reject(toLintErrorObject(err, "MSTeams server failed"));
3978
3978
  };
3979
3979
  httpServer.once("listening", onListening);
3980
3980
  httpServer.once("error", onError);
@@ -4002,6 +4002,13 @@ async function monitorMSTeamsProvider(opts) {
4002
4002
  shutdown
4003
4003
  };
4004
4004
  }
4005
+ function toLintErrorObject(value, fallbackMessage) {
4006
+ if (value instanceof Error) return value;
4007
+ if (typeof value === "string") return new Error(value);
4008
+ const error = new Error(fallbackMessage, { cause: value });
4009
+ if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
4010
+ return error;
4011
+ }
4005
4012
  /**
4006
4013
  * Build a minimal ActivityHandler-compatible object that supports
4007
4014
  * onMessage / onMembersAdded registration and a run() method.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/msteams",
3
- "version": "2026.5.31-beta.3",
3
+ "version": "2026.5.31-beta.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/msteams",
9
- "version": "2026.5.31-beta.3",
9
+ "version": "2026.5.31-beta.4",
10
10
  "dependencies": {
11
11
  "@azure/identity": "4.13.1",
12
12
  "@microsoft/teams.api": "2.0.12",
@@ -15,7 +15,7 @@
15
15
  "typebox": "1.1.39"
16
16
  },
17
17
  "peerDependencies": {
18
- "openclaw": ">=2026.5.31-beta.3"
18
+ "openclaw": ">=2026.5.31-beta.4"
19
19
  },
20
20
  "peerDependenciesMeta": {
21
21
  "openclaw": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/msteams",
3
- "version": "2026.5.31-beta.3",
3
+ "version": "2026.5.31-beta.4",
4
4
  "description": "OpenClaw Microsoft Teams channel plugin for bot conversations.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "typebox": "1.1.39"
16
16
  },
17
17
  "peerDependencies": {
18
- "openclaw": ">=2026.5.31-beta.3"
18
+ "openclaw": ">=2026.5.31-beta.4"
19
19
  },
20
20
  "peerDependenciesMeta": {
21
21
  "openclaw": {
@@ -51,10 +51,10 @@
51
51
  "minHostVersion": ">=2026.4.10"
52
52
  },
53
53
  "compat": {
54
- "pluginApi": ">=2026.5.31-beta.3"
54
+ "pluginApi": ">=2026.5.31-beta.4"
55
55
  },
56
56
  "build": {
57
- "openclawVersion": "2026.5.31-beta.3"
57
+ "openclawVersion": "2026.5.31-beta.4"
58
58
  },
59
59
  "release": {
60
60
  "publishToClawHub": true,