@openclaw/msteams 2026.6.8 → 2026.6.9

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 { t as msteamsPlugin } from "./channel-FzXHnZIM.js";
2
- import { c as msteamsSetupAdapter, n as openDelegatedOAuthUrl, s as createMSTeamsSetupWizardBase, t as msteamsSetupWizard } from "./setup-surface-Dik4VU7f.js";
1
+ import { t as msteamsPlugin } from "./channel-Dg0iJjJY.js";
2
+ import { c as msteamsSetupAdapter, n as openDelegatedOAuthUrl, s as createMSTeamsSetupWizardBase, t as msteamsSetupWizard } from "./setup-surface-C9bk1fMr.js";
3
3
  export { createMSTeamsSetupWizardBase, msteamsPlugin, msteamsSetupAdapter, msteamsSetupWizard, openDelegatedOAuthUrl };
@@ -1,7 +1,7 @@
1
1
  import { DEFAULT_ACCOUNT_ID, PAIRING_APPROVED_MESSAGE, buildChannelKeyCandidates, buildProbeChannelStatusSummary, chunkTextForOutbound, createDefaultChannelRuntimeState, isDangerousNameMatchingEnabled, normalizeChannelSlug, resolveAllowlistMatchSimple, resolveChannelEntryMatchWithFallback, resolveNestedAllowlistDecision, resolveToolsBySender } from "./runtime-api.js";
2
- import { C as resolveMSTeamsCredentials, a as parseMSTeamsTeamChannelInput, c as resolveMSTeamsUserAllowlist, i as parseMSTeamsConversationId, n as normalizeMSTeamsMessagingTarget, r as normalizeMSTeamsUserInput, s as resolveMSTeamsChannelAllowlist, t as looksLikeMSTeamsTargetId } from "./resolve-allowlist-BzIUWmMm.js";
2
+ import { C as resolveMSTeamsCredentials, a as parseMSTeamsTeamChannelInput, c as resolveMSTeamsUserAllowlist, i as parseMSTeamsConversationId, n as normalizeMSTeamsMessagingTarget, r as normalizeMSTeamsUserInput, s as resolveMSTeamsChannelAllowlist, t as looksLikeMSTeamsTargetId } from "./resolve-allowlist-NQ2WSrBX.js";
3
3
  import { t as MSTeamsChannelConfigSchema } from "./config-schema-BL4qQZiA.js";
4
- import { c as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-Dik4VU7f.js";
4
+ import { c as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-C9bk1fMr.js";
5
5
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
6
6
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
7
7
  import { createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
@@ -336,7 +336,7 @@ const collectMSTeamsSecurityWarnings = createAllowlistProviderGroupPolicyWarning
336
336
  resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
337
337
  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."] : []
338
338
  });
339
- const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CaeTVmSx.js"), "msTeamsChannelRuntime");
339
+ const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CbYGdKDW.js"), "msTeamsChannelRuntime");
340
340
  const resolveMSTeamsChannelConfig = (cfg) => ({
341
341
  allowFrom: cfg.channels?.msteams?.allowFrom,
342
342
  defaultTo: cfg.channels?.msteams?.defaultTo
@@ -1131,7 +1131,7 @@ const msteamsPlugin = createChatChannelPlugin({
1131
1131
  })
1132
1132
  }),
1133
1133
  gateway: { startAccount: async (ctx) => {
1134
- const { monitorMSTeamsProvider } = await import("./src-C647R5Nw.js");
1134
+ const { monitorMSTeamsProvider } = await import("./src-Bjvh443N.js");
1135
1135
  const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
1136
1136
  ctx.setStatus({
1137
1137
  accountId: ctx.accountId,
@@ -1,2 +1,2 @@
1
- import { t as msteamsPlugin } from "./channel-FzXHnZIM.js";
1
+ import { t as msteamsPlugin } from "./channel-Dg0iJjJY.js";
2
2
  export { msteamsPlugin };
@@ -1,8 +1,8 @@
1
1
  import { chunkTextForOutbound, normalizeStringEntries as normalizeStringEntries$1 } from "./runtime-api.js";
2
- import { _ as patchGraphJson, b as resolveGraphToken, d as escapeOData, f as fetchGraphAbsoluteUrl, g as normalizeQuery, h as listTeamsByName, l as searchGraphUsers, m as listChannelsForTeam, p as fetchGraphJson, u as deleteGraphRequest, v as postGraphBetaJson, y as postGraphJson } from "./resolve-allowlist-BzIUWmMm.js";
3
- import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-FzXHnZIM.js";
2
+ import { _ as patchGraphJson, b as resolveGraphToken, d as escapeOData, f as fetchGraphAbsoluteUrl, g as normalizeQuery, h as listTeamsByName, l as searchGraphUsers, m as listChannelsForTeam, p as fetchGraphJson, u as deleteGraphRequest, v as postGraphBetaJson, y as postGraphJson } from "./resolve-allowlist-NQ2WSrBX.js";
3
+ import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-Dg0iJjJY.js";
4
4
  import { l as createMSTeamsPollStoreState, v as createMSTeamsConversationStoreState } from "./polls-C1VgSvKE.js";
5
- import { a as sendMessageMSTeams, i as sendAdaptiveCardMSTeams, n as deleteMessageMSTeams, o as sendPollMSTeams, r as editMessageMSTeams, t as probeMSTeams } from "./probe-D-pKTqs9.js";
5
+ import { a as sendMessageMSTeams, i as sendAdaptiveCardMSTeams, n as deleteMessageMSTeams, o as sendPollMSTeams, r as editMessageMSTeams, t as probeMSTeams } from "./probe-cF7YlXjL.js";
6
6
  import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
7
7
  import { normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  import { resolvePayloadMediaUrls, resolveTextChunksWithFallback, sendPayloadMediaSequence } from "openclaw/plugin-sdk/reply-payload";
@@ -1,4 +1,4 @@
1
- import { C as resolveMSTeamsCredentials, n as normalizeMSTeamsMessagingTarget } from "./resolve-allowlist-BzIUWmMm.js";
1
+ import { C as resolveMSTeamsCredentials, n as normalizeMSTeamsMessagingTarget } from "./resolve-allowlist-NQ2WSrBX.js";
2
2
  import { listDirectoryEntriesFromSources } from "openclaw/plugin-sdk/directory-runtime";
3
3
  const msteamsDirectoryContractPlugin = {
4
4
  id: "msteams",
@@ -1,4 +1,4 @@
1
- import { A as MSTEAMS_OAUTH_REDIRECT_URI, D as MSTEAMS_DEFAULT_DELEGATED_SCOPES, E as exchangeMSTeamsCodeForTokens, O as MSTEAMS_OAUTH_CALLBACK_PATH, j as buildMSTeamsAuthEndpoint, k as MSTEAMS_OAUTH_CALLBACK_PORT } from "./resolve-allowlist-BzIUWmMm.js";
1
+ import { A as MSTEAMS_OAUTH_REDIRECT_URI, D as MSTEAMS_DEFAULT_DELEGATED_SCOPES, E as exchangeMSTeamsCodeForTokens, O as MSTEAMS_OAUTH_CALLBACK_PATH, j as buildMSTeamsAuthEndpoint, k as MSTEAMS_OAUTH_CALLBACK_PORT } from "./resolve-allowlist-NQ2WSrBX.js";
2
2
  import { generateHexPkceVerifierChallenge } from "openclaw/plugin-sdk/provider-auth";
3
3
  import { generateOAuthState, parseOAuthCallbackInput, waitForLocalOAuthCallback } from "openclaw/plugin-sdk/provider-auth-runtime";
4
4
  import { isWSL2Sync } from "openclaw/plugin-sdk/runtime-env";
@@ -1,8 +1,8 @@
1
1
  import { t as getMSTeamsRuntime } from "./runtime-BS5AZrKK.js";
2
2
  import { detectMime, extensionForMime, extractOriginalFilename, getFileExtension, loadOutboundMediaFromUrl, normalizeStringEntries as normalizeStringEntries$1, resolveChannelMediaMaxBytes } from "./runtime-api.js";
3
- import { B as normalizeBotFrameworkServiceUrl, C as resolveMSTeamsCredentials, F as loadMSTeamsSdkWithAuth, H as createMSTeamsHttpError, I as buildUserAgent, M as readAccessToken, P as createMSTeamsTokenProvider, R as describeBotFrameworkServiceUrlHost, S as loadDelegatedTokens, U as resolveMSTeamsSdkCloudOptions, W as validateMSTeamsProactiveServiceUrlBoundary, z as isAllowedBotFrameworkServiceUrl } from "./resolve-allowlist-BzIUWmMm.js";
4
- import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-FzXHnZIM.js";
5
- import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, o as isRevokedProxyError, r as classifyMSTeamsSendError } from "./setup-surface-Dik4VU7f.js";
3
+ import { B as normalizeBotFrameworkServiceUrl, C as resolveMSTeamsCredentials, F as loadMSTeamsSdkWithAuth, H as createMSTeamsHttpError, I as buildUserAgent, M as readAccessToken, P as createMSTeamsTokenProvider, R as describeBotFrameworkServiceUrlHost, S as loadDelegatedTokens, U as resolveMSTeamsSdkCloudOptions, W as validateMSTeamsProactiveServiceUrlBoundary, z as isAllowedBotFrameworkServiceUrl } from "./resolve-allowlist-NQ2WSrBX.js";
4
+ import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-Dg0iJjJY.js";
5
+ import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, o as isRevokedProxyError, r as classifyMSTeamsSendError } from "./setup-surface-C9bk1fMr.js";
6
6
  import { C as toPluginJsonValue, S as resolveMSTeamsSqliteStateEnv, o as buildMSTeamsPollCard, v as createMSTeamsConversationStoreState, w as withMSTeamsSqliteMutationLock } from "./polls-C1VgSvKE.js";
7
7
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -364,7 +364,7 @@ const NULL_BODY_STATUSES$1 = new Set([
364
364
  205,
365
365
  304
366
366
  ]);
367
- function responseWithRelease(response, release) {
367
+ function responseWithRelease$1(response, release) {
368
368
  let released = false;
369
369
  const releaseOnce = async () => {
370
370
  if (released) return;
@@ -435,7 +435,7 @@ async function safeFetch(params) {
435
435
  retainAuthorizationRedirectHostnameAllowlist: resolveRetainedAuthorizationRedirectHostnameAllowlist(params.authorizationAllowHosts),
436
436
  auditContext: "msteams.attachment"
437
437
  });
438
- return responseWithRelease(guarded.response, guarded.release);
438
+ return responseWithRelease$1(guarded.response, guarded.release);
439
439
  }
440
440
  if (resolveFn) try {
441
441
  const initialHost = new URL(currentUrl).hostname;
@@ -552,7 +552,6 @@ const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = normalizeHostnameSuffixAllowlis
552
552
  "smba.infra.dod.teams.microsoft.us",
553
553
  "botframework.azure.cn"
554
554
  ]);
555
- if (!buildHostnameAllowlistPolicyFromSuffixAllowlist(BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST)) throw new Error("Microsoft Teams Bot Framework serviceUrl allowlist is empty");
556
555
  function describeBotFrameworkServiceUrlHost(serviceUrl) {
557
556
  try {
558
557
  return new URL(serviceUrl.trim()).hostname || "invalid-url";
@@ -960,6 +959,44 @@ const NULL_BODY_STATUSES = new Set([
960
959
  205,
961
960
  304
962
961
  ]);
962
+ function responseWithRelease(response, release) {
963
+ let released = false;
964
+ const releaseOnce = async () => {
965
+ if (released) return;
966
+ released = true;
967
+ await release();
968
+ };
969
+ if (!response.body || NULL_BODY_STATUSES.has(response.status)) {
970
+ releaseOnce();
971
+ return response;
972
+ }
973
+ const reader = response.body.getReader();
974
+ const body = new ReadableStream({
975
+ async pull(controller) {
976
+ try {
977
+ const next = await reader.read();
978
+ if (next.done) {
979
+ controller.close();
980
+ await releaseOnce();
981
+ return;
982
+ }
983
+ controller.enqueue(next.value);
984
+ } catch (error) {
985
+ await releaseOnce();
986
+ throw error;
987
+ }
988
+ },
989
+ async cancel(reason) {
990
+ reader.cancel(reason).catch(() => void 0);
991
+ await releaseOnce();
992
+ }
993
+ });
994
+ return new Response(body, {
995
+ status: response.status,
996
+ statusText: response.statusText,
997
+ headers: response.headers
998
+ });
999
+ }
963
1000
  function normalizeQuery(value) {
964
1001
  return value?.trim() ?? "";
965
1002
  }
@@ -985,16 +1022,13 @@ async function requestGraph(params) {
985
1022
  },
986
1023
  auditContext: "msteams.graph"
987
1024
  });
1025
+ let releaseInFinally = true;
988
1026
  try {
989
1027
  if (!response.ok) throw await createMSTeamsHttpError(response, `${params.errorPrefix ?? "Graph"} ${params.path} failed`);
990
- const body = NULL_BODY_STATUSES.has(response.status) ? null : await response.arrayBuffer();
991
- return new Response(body, {
992
- status: response.status,
993
- statusText: response.statusText,
994
- headers: new Headers(response.headers)
995
- });
1028
+ releaseInFinally = false;
1029
+ return responseWithRelease(response, release);
996
1030
  } finally {
997
- await release();
1031
+ if (releaseInFinally) await release();
998
1032
  }
999
1033
  }
1000
1034
  async function readOptionalGraphJson(res, label) {
@@ -1,6 +1,6 @@
1
- import { C as resolveMSTeamsCredentials } from "./resolve-allowlist-BzIUWmMm.js";
1
+ import { C as resolveMSTeamsCredentials } from "./resolve-allowlist-NQ2WSrBX.js";
2
2
  import { t as MSTeamsChannelConfigSchema } from "./config-schema-BL4qQZiA.js";
3
- import { c as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-Dik4VU7f.js";
3
+ import { c as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-C9bk1fMr.js";
4
4
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
5
5
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
6
6
  import { createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
@@ -1,4 +1,4 @@
1
- import { C as resolveMSTeamsCredentials, T as normalizeSecretInputString, c as resolveMSTeamsUserAllowlist, o as parseMSTeamsTeamEntry, s as resolveMSTeamsChannelAllowlist, w as saveDelegatedTokens, x as hasConfiguredMSTeamsCredentials } from "./resolve-allowlist-BzIUWmMm.js";
1
+ import { C as resolveMSTeamsCredentials, T as normalizeSecretInputString, c as resolveMSTeamsUserAllowlist, o as parseMSTeamsTeamEntry, s as resolveMSTeamsChannelAllowlist, w as saveDelegatedTokens, x as hasConfiguredMSTeamsCredentials } from "./resolve-allowlist-NQ2WSrBX.js";
2
2
  import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
4
4
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, createStandardChannelSetupStatus, createTopLevelChannelAllowFromSetter, createTopLevelChannelDmPolicy, createTopLevelChannelGroupPolicySetter, mergeAllowFromEntries, splitSetupEntries } from "openclaw/plugin-sdk/setup";
@@ -449,7 +449,7 @@ const msteamsSetupWizard = {
449
449
  }
450
450
  };
451
451
  try {
452
- const { loginMSTeamsDelegated } = await import("./oauth-CDUB5xPY.js");
452
+ const { loginMSTeamsDelegated } = await import("./oauth-B0h3B9GX.js");
453
453
  const progress = params.prompter.progress(t("wizard.msteams.delegatedOAuthProgress"));
454
454
  saveDelegatedTokens(await loginMSTeamsDelegated({
455
455
  isRemote: true,
@@ -1,14 +1,14 @@
1
1
  import { n as getOptionalMSTeamsRuntime, t as getMSTeamsRuntime } from "./runtime-BS5AZrKK.js";
2
2
  import { DEFAULT_ACCOUNT_ID, DEFAULT_WEBHOOK_MAX_BODY_BYTES, buildMediaPayload, createChannelMessageReplyPipeline, createChannelPairingController, dispatchReplyFromConfigWithSettledDispatcher as dispatchReplyFromConfigWithSettledDispatcher$1, isDangerousNameMatchingEnabled, keepHttpServerTaskAlive, logTypingFailure, mergeAllowlist, resolveChannelMediaMaxBytes, resolveDefaultGroupPolicy, summarizeMapping } from "./runtime-api.js";
3
- import { $ as inferPlaceholder, C as resolveMSTeamsCredentials, F as loadMSTeamsSdkWithAuth, G as ATTACHMENT_TAG_RE, J as applyAuthorizationHeaderForUrl, K as GRAPH_ROOT, L as ensureUserAgentHeader, N as createMSTeamsExpressAdapter, P as createMSTeamsTokenProvider, Q as extractInlineImageCandidates, U as resolveMSTeamsSdkCloudOptions, V as tryNormalizeBotFrameworkServiceUrl, X as estimateBase64DecodedBytes, Y as encodeGraphShareId, Z as extractHtmlFromAttachment, at as readNestedString, c as resolveMSTeamsUserAllowlist, ct as resolveRequestUrl, dt as tryBuildGraphSharesUrlForSharedLink, et as isDownloadableAttachment, it as normalizeContentType, lt as safeFetchWithPolicy, nt as isRecord$1, ot as resolveAttachmentFetchPolicy, p as fetchGraphJson, q as IMG_SRC_RE, rt as isUrlAllowed, s as resolveMSTeamsChannelAllowlist, st as resolveMediaSsrfPolicy, tt as isLikelyImageAttachment, ut as safeHostForUrl } from "./resolve-allowlist-BzIUWmMm.js";
4
- import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-FzXHnZIM.js";
5
- import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, r as classifyMSTeamsSendError } from "./setup-surface-Dik4VU7f.js";
3
+ import { $ as inferPlaceholder, C as resolveMSTeamsCredentials, F as loadMSTeamsSdkWithAuth, G as ATTACHMENT_TAG_RE, J as applyAuthorizationHeaderForUrl, K as GRAPH_ROOT, L as ensureUserAgentHeader, N as createMSTeamsExpressAdapter, P as createMSTeamsTokenProvider, Q as extractInlineImageCandidates, U as resolveMSTeamsSdkCloudOptions, V as tryNormalizeBotFrameworkServiceUrl, X as estimateBase64DecodedBytes, Y as encodeGraphShareId, Z as extractHtmlFromAttachment, at as readNestedString, c as resolveMSTeamsUserAllowlist, ct as resolveRequestUrl, dt as tryBuildGraphSharesUrlForSharedLink, et as isDownloadableAttachment, it as normalizeContentType, lt as safeFetchWithPolicy, nt as isRecord$1, ot as resolveAttachmentFetchPolicy, p as fetchGraphJson, q as IMG_SRC_RE, rt as isUrlAllowed, s as resolveMSTeamsChannelAllowlist, st as resolveMediaSsrfPolicy, tt as isLikelyImageAttachment, ut as safeHostForUrl } from "./resolve-allowlist-NQ2WSrBX.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-Dg0iJjJY.js";
5
+ import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, r as classifyMSTeamsSendError } from "./setup-surface-C9bk1fMr.js";
6
6
  import { l as createMSTeamsPollStoreState, u as extractMSTeamsPollVote, v as createMSTeamsConversationStoreState } from "./polls-C1VgSvKE.js";
7
7
  import { i as createMSTeamsSsoTokenStoreFs } from "./sso-token-store-BYZaKr82.js";
8
- import { _ as buildFileInfoCard, 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, y as uploadToConsentUrl } from "./probe-D-pKTqs9.js";
8
+ import { _ as buildFileInfoCard, 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, y as uploadToConsentUrl } from "./probe-cF7YlXjL.js";
9
9
  import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/allow-from";
10
10
  import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelProgressDraftGate, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, normalizeChannelProgressDraftLineIdentity, resolveChannelPreviewStreamMode, resolveChannelProgressDraftMaxLines, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
11
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
11
+ import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
12
12
  import { parseMediaContentLength, saveResponseMedia } from "openclaw/plugin-sdk/media-runtime";
13
13
  import { buildChannelInboundEventContext, dispatchReplyFromConfigWithSettledDispatcher, hasFinalInboundReplyDispatch, logInboundDrop, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, resolveInboundSessionEnvelopeContext } from "openclaw/plugin-sdk/channel-inbound";
14
14
  import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
@@ -1932,6 +1932,8 @@ function createMSTeamsReplyDispatcher(params) {
1932
1932
  const detailMode = typeof payload?.detailMode === "string" ? payload.detailMode : void 0;
1933
1933
  await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1934
1934
  event: "tool",
1935
+ ...typeof payload?.itemId === "string" ? { itemId: payload.itemId } : {},
1936
+ ...typeof payload?.toolCallId === "string" ? { toolCallId: payload.toolCallId } : {},
1935
1937
  ...name ? { name } : {},
1936
1938
  ...typeof payload?.phase === "string" ? { phase: payload.phase } : {},
1937
1939
  ...payload?.args && typeof payload.args === "object" ? { args: payload.args } : {}
@@ -1940,6 +1942,8 @@ function createMSTeamsReplyDispatcher(params) {
1940
1942
  onItemEvent: async (payload) => {
1941
1943
  await streamController.pushProgressLine(buildChannelProgressDraftLineForEntry(msteamsCfg, {
1942
1944
  event: "item",
1945
+ ...typeof payload?.itemId === "string" ? { itemId: payload.itemId } : {},
1946
+ ...typeof payload?.toolCallId === "string" ? { toolCallId: payload.toolCallId } : {},
1943
1947
  ...typeof payload?.kind === "string" ? { itemKind: payload.kind } : {},
1944
1948
  ...typeof payload?.title === "string" ? { title: payload.title } : {},
1945
1949
  ...typeof payload?.name === "string" ? { name: payload.name } : {},
@@ -1975,6 +1979,8 @@ function createMSTeamsReplyDispatcher(params) {
1975
1979
  if (payload?.phase !== "end") return;
1976
1980
  await streamController.pushProgressLine(buildChannelProgressDraftLine({
1977
1981
  event: "command-output",
1982
+ ...typeof payload?.itemId === "string" ? { itemId: payload.itemId } : {},
1983
+ ...typeof payload?.toolCallId === "string" ? { toolCallId: payload.toolCallId } : {},
1978
1984
  phase: payload.phase,
1979
1985
  ...typeof payload?.title === "string" ? { title: payload.title } : {},
1980
1986
  ...typeof payload?.name === "string" ? { name: payload.name } : {},
@@ -1986,6 +1992,8 @@ function createMSTeamsReplyDispatcher(params) {
1986
1992
  if (payload?.phase !== "end") return;
1987
1993
  await streamController.pushProgressLine(buildChannelProgressDraftLine({
1988
1994
  event: "patch",
1995
+ ...typeof payload?.itemId === "string" ? { itemId: payload.itemId } : {},
1996
+ ...typeof payload?.toolCallId === "string" ? { toolCallId: payload.toolCallId } : {},
1989
1997
  phase: payload.phase,
1990
1998
  ...typeof payload?.title === "string" ? { title: payload.title } : {},
1991
1999
  ...typeof payload?.name === "string" ? { name: payload.name } : {},
@@ -2506,7 +2514,7 @@ function createMSTeamsMessageHandler(deps) {
2506
2514
  });
2507
2515
  const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
2508
2516
  const inboundLabel = isDirectMessage ? `Teams DM from ${senderName}` : `Teams message in ${conversationType} from ${senderName}`;
2509
- const enqueuePrimaryMessageSystemEvent = () => core.system.enqueueSystemEvent(`${inboundLabel}: ${preview}`, {
2517
+ const enqueuePrimaryMessageSystemEvent = () => core.system.enqueueSystemEvent(inboundLabel, {
2510
2518
  sessionKey: route.sessionKey,
2511
2519
  contextKey: `msteams:message:${conversationId}:${activity.id ?? "unknown"}`
2512
2520
  });
@@ -3029,14 +3037,29 @@ function buildGroupWelcomeText(botName) {
3029
3037
  }
3030
3038
  //#endregion
3031
3039
  //#region extensions/msteams/src/monitor-handler.ts
3040
+ function extractAdaptiveCardSubmittedData(value) {
3041
+ if (!isRecord(value)) return value;
3042
+ const action = isRecord(value.action) ? value.action : void 0;
3043
+ if (action && normalizeOptionalLowercaseString(action.type) === "action.submit" && "data" in action) return action.data;
3044
+ return value;
3045
+ }
3046
+ function readMSTeamsImBackValue(value) {
3047
+ if (!isRecord(value)) return null;
3048
+ const msteams = isRecord(value.msteams) ? value.msteams : void 0;
3049
+ if (!msteams || normalizeOptionalLowercaseString(msteams.type) !== "imback") return null;
3050
+ return normalizeOptionalString(msteams.value) ?? null;
3051
+ }
3032
3052
  function serializeAdaptiveCardActionValue(value) {
3033
- if (typeof value === "string") {
3034
- const trimmed = value.trim();
3053
+ const submittedValue = extractAdaptiveCardSubmittedData(value);
3054
+ if (typeof submittedValue === "string") {
3055
+ const trimmed = submittedValue.trim();
3035
3056
  return trimmed ? trimmed : null;
3036
3057
  }
3037
- if (value === void 0) return null;
3058
+ const imBackValue = readMSTeamsImBackValue(submittedValue);
3059
+ if (imBackValue) return imBackValue;
3060
+ if (submittedValue == null) return null;
3038
3061
  try {
3039
- return JSON.stringify(value);
3062
+ return JSON.stringify(submittedValue);
3040
3063
  } catch {
3041
3064
  return null;
3042
3065
  }
@@ -277,6 +277,11 @@ const parseComparator = (comp, options) => {
277
277
 
278
278
  const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
279
279
 
280
+ const invalidXRangeOrder = (M, m, p) => (
281
+ (isX(M) && !isX(m)) ||
282
+ (isX(m) && p && !isX(p))
283
+ )
284
+
280
285
  // ~, ~> --> * (any, kinda silly)
281
286
  // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
282
287
  // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
@@ -373,10 +378,10 @@ const replaceCaret = (comp, options) => {
373
378
  if (M === '0') {
374
379
  if (m === '0') {
375
380
  ret = `>=${M}.${m}.${p
376
- }${z} <${M}.${m}.${+p + 1}-0`
381
+ } <${M}.${m}.${+p + 1}-0`
377
382
  } else {
378
383
  ret = `>=${M}.${m}.${p
379
- }${z} <${M}.${+m + 1}.0-0`
384
+ } <${M}.${+m + 1}.0-0`
380
385
  }
381
386
  } else {
382
387
  ret = `>=${M}.${m}.${p
@@ -402,6 +407,10 @@ const replaceXRange = (comp, options) => {
402
407
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
403
408
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
404
409
  debug('xRange', comp, ret, gtlt, M, m, p, pr)
410
+ if (invalidXRangeOrder(M, m, p)) {
411
+ return comp
412
+ }
413
+
405
414
  const xM = isX(M)
406
415
  const xm = xM || isX(m)
407
416
  const xp = xm || isX(p)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "7.8.2",
3
+ "version": "7.8.4",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,7 +14,7 @@
14
14
  "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
15
15
  },
16
16
  "devDependencies": {
17
- "@npmcli/eslint-config": "^6.0.0",
17
+ "@npmcli/eslint-config": "^7.0.0",
18
18
  "@npmcli/template-oss": "5.0.0",
19
19
  "benchmark": "^2.1.4",
20
20
  "tap": "^16.0.0"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/msteams",
3
- "version": "2026.6.8",
3
+ "version": "2026.6.9",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/msteams",
9
- "version": "2026.6.8",
9
+ "version": "2026.6.9",
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.6.8"
18
+ "openclaw": ">=2026.6.9"
19
19
  },
20
20
  "peerDependenciesMeta": {
21
21
  "openclaw": {
@@ -1467,9 +1467,9 @@
1467
1467
  "license": "MIT"
1468
1468
  },
1469
1469
  "node_modules/semver": {
1470
- "version": "7.8.2",
1471
- "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.2.tgz",
1472
- "integrity": "sha512-c8jsqUZm3omBOI66G90z1Dyw5z622G8oLG+omfsHBJf3CWQTlOcwOjvOG6wtiNfW6anKm/eA39LMwMtMez2TiQ==",
1470
+ "version": "7.8.4",
1471
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.4.tgz",
1472
+ "integrity": "sha512-rUCObTnP32Q08R2uuIrt7r9PlEonuTmtuXYcW6s5kjdlj3xbnwe+21yXptAUYcMAABLkYYTtnmzb3w3EDZfueA==",
1473
1473
  "license": "ISC",
1474
1474
  "bin": {
1475
1475
  "semver": "bin/semver.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/msteams",
3
- "version": "2026.6.8",
3
+ "version": "2026.6.9",
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.6.8"
18
+ "openclaw": ">=2026.6.9"
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.6.8"
54
+ "pluginApi": ">=2026.6.9"
55
55
  },
56
56
  "build": {
57
- "openclawVersion": "2026.6.8"
57
+ "openclawVersion": "2026.6.9"
58
58
  },
59
59
  "release": {
60
60
  "publishToClawHub": true,