@openclaw/msteams 2026.5.31-beta.2 → 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-CqRTzeBc.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";
@@ -10,7 +10,7 @@ import { createChannelMessageAdapterFromOutbound, createRuntimeOutboundDelegates
10
10
  import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
11
11
  import { createAllowlistProviderGroupPolicyWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector, projectConfigWarningCollector } from "openclaw/plugin-sdk/channel-policy";
12
12
  import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter, listDirectoryEntriesFromSources } from "openclaw/plugin-sdk/directory-runtime";
13
- import { adaptMessagePresentationForChannel, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
13
+ import { adaptMessagePresentationForChannel, normalizeMessagePresentation, resolveMessagePresentationControlValue } from "openclaw/plugin-sdk/interactive-runtime";
14
14
  import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
15
15
  import { createComputedAccountStatusAdapter } from "openclaw/plugin-sdk/status-helpers";
16
16
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -263,11 +263,12 @@ function buildMSTeamsPresentationCard(params) {
263
263
  });
264
264
  continue;
265
265
  }
266
- if (button.value) actions.push({
266
+ const value = resolveMessagePresentationControlValue(button);
267
+ if (value) actions.push({
267
268
  type: "Action.Submit",
268
269
  title: button.label,
269
- data: {
270
- value: button.value,
270
+ data: button.action?.type === "command" ? value : {
271
+ value,
271
272
  label: button.label
272
273
  }
273
274
  });
@@ -330,7 +331,7 @@ const collectMSTeamsSecurityWarnings = createAllowlistProviderGroupPolicyWarning
330
331
  resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
331
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."] : []
332
333
  });
333
- const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-C38epVZr.js"), "msTeamsChannelRuntime");
334
+ const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-t52N99bX.js"), "msTeamsChannelRuntime");
334
335
  const resolveMSTeamsChannelConfig = (cfg) => ({
335
336
  allowFrom: cfg.channels?.msteams?.allowFrom,
336
337
  defaultTo: cfg.channels?.msteams?.defaultTo
@@ -1116,7 +1117,7 @@ const msteamsPlugin = createChatChannelPlugin({
1116
1117
  })
1117
1118
  }),
1118
1119
  gateway: { startAccount: async (ctx) => {
1119
- const { monitorMSTeamsProvider } = await import("./src-B6CFMcvV.js");
1120
+ const { monitorMSTeamsProvider } = await import("./src-DZ76sgTp.js");
1120
1121
  const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
1121
1122
  ctx.setStatus({
1122
1123
  accountId: ctx.accountId,
@@ -1,2 +1,2 @@
1
- import { t as msteamsPlugin } from "./channel-CqRTzeBc.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-CqRTzeBc.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-DMNefdBZ.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";
@@ -588,8 +588,8 @@ const msTeamsChannelRuntime = {
588
588
  const result = await sendPayloadMediaSequence({
589
589
  text,
590
590
  mediaUrls,
591
- send: async ({ text, mediaUrl }) => await send(to, text, {
592
- mediaUrl,
591
+ send: async ({ text: textLocal, mediaUrl: mediaUrlLocal }) => await send(to, textLocal, {
592
+ mediaUrl: mediaUrlLocal,
593
593
  mediaLocalRoots,
594
594
  mediaReadFile
595
595
  })
@@ -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-CqRTzeBc.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-CqRTzeBc.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-DMNefdBZ.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";
@@ -1589,8 +1589,8 @@ function createTeamsReplyStreamController(params) {
1589
1589
  if (!stream || streamMode !== "progress") return;
1590
1590
  if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
1591
1591
  const hadStarted = progressDraftGate.hasStarted;
1592
- await progressDraftGate.noteWork();
1593
- if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1592
+ const progressActive = await progressDraftGate.noteWork();
1593
+ if ((hadStarted || progressActive) && progressDraftGate.hasStarted) renderInformativeUpdate();
1594
1594
  },
1595
1595
  /**
1596
1596
  * Append a tool-progress line (e.g. a tool name being invoked) into the
@@ -1605,8 +1605,8 @@ function createTeamsReplyStreamController(params) {
1605
1605
  if (normalized) progressLines = mergeChannelProgressDraftLine(progressLines, typeof line === "object" && line !== void 0 ? line : normalized, { maxLines: resolveChannelProgressDraftMaxLines(params.msteamsConfig) });
1606
1606
  }
1607
1607
  const hadStarted = progressDraftGate.hasStarted;
1608
- await progressDraftGate.noteWork();
1609
- if (hadStarted && progressDraftGate.hasStarted) renderInformativeUpdate();
1608
+ const progressActive = await progressDraftGate.noteWork();
1609
+ if ((hadStarted || progressActive) && progressDraftGate.hasStarted) renderInformativeUpdate();
1610
1610
  },
1611
1611
  preparePayload(payload) {
1612
1612
  if (!stream) return payload;
@@ -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.2",
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.2",
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.2"
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.2",
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.2"
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.2"
54
+ "pluginApi": ">=2026.5.31-beta.4"
55
55
  },
56
56
  "build": {
57
- "openclawVersion": "2026.5.31-beta.2"
57
+ "openclawVersion": "2026.5.31-beta.4"
58
58
  },
59
59
  "release": {
60
60
  "publishToClawHub": true,