@openclaw/msteams 2026.6.11-beta.2 → 2026.7.1-beta.1

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-D6Se2irO.js";
1
+ import { t as msteamsPlugin } from "./channel-BrQGaAEV.js";
2
2
  import { c as msteamsSetupAdapter, n as openDelegatedOAuthUrl, s as createMSTeamsSetupWizardBase, t as msteamsSetupWizard } from "./setup-surface-CuIeEFrR.js";
3
3
  export { createMSTeamsSetupWizardBase, msteamsPlugin, msteamsSetupAdapter, msteamsSetupWizard, openDelegatedOAuthUrl };
@@ -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-DIplgUVW.js"), "msTeamsChannelRuntime");
339
+ const loadMSTeamsChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-CjEyJo5B.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-DgSUjtxR.js");
1134
+ const { monitorMSTeamsProvider } = await import("./src-doNP_Xd_.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-D6Se2irO.js";
1
+ import { t as msteamsPlugin } from "./channel-BrQGaAEV.js";
2
2
  export { msteamsPlugin };
@@ -1,8 +1,8 @@
1
1
  import { chunkTextForOutbound, normalizeStringEntries as normalizeStringEntries$1 } from "./runtime-api.js";
2
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-DlH_aNya.js";
3
- import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-D6Se2irO.js";
3
+ import { n as MSTEAMS_PRESENTATION_CAPABILITIES, r as buildMSTeamsPresentationCard } from "./channel-BrQGaAEV.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-Cl6_-FSx.js";
5
+ import { a as sendMessageMSTeams, i as sendAdaptiveCardMSTeams, n as deleteMessageMSTeams, o as sendPollMSTeams, r as editMessageMSTeams, t as probeMSTeams } from "./probe-CiZIJ_eX.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,7 +1,7 @@
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
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-DlH_aNya.js";
4
- import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-D6Se2irO.js";
4
+ import { a as resolveMSTeamsReplyPolicy, o as resolveMSTeamsRouteConfig } from "./channel-BrQGaAEV.js";
5
5
  import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, o as isRevokedProxyError, r as classifyMSTeamsSendError } from "./setup-surface-CuIeEFrR.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";
@@ -1,11 +1,11 @@
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
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-DlH_aNya.js";
4
- import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-D6Se2irO.js";
4
+ import { a as resolveMSTeamsReplyPolicy, i as resolveMSTeamsAllowlistMatch, o as resolveMSTeamsRouteConfig } from "./channel-BrQGaAEV.js";
5
5
  import { a as formatUnknownError, i as formatMSTeamsSendErrorHint, r as classifyMSTeamsSendError } from "./setup-surface-CuIeEFrR.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-Cl6_-FSx.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-CiZIJ_eX.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
11
  import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -16,6 +16,7 @@ import path from "node:path";
16
16
  import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
17
17
  import { appendRegularFile } from "openclaw/plugin-sdk/security-runtime";
18
18
  import crypto from "node:crypto";
19
+ import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
19
20
  import { resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
20
21
  import { channelIngressRoutes, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
21
22
  import { filterSupplementalContextItems, resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
@@ -26,7 +27,7 @@ const MAX_RESPONSE_CHARS = 500;
26
27
  function buildReflectionPrompt(params) {
27
28
  const parts = ["A user indicated your previous response wasn't helpful."];
28
29
  if (params.thumbedDownResponse) {
29
- const truncated = params.thumbedDownResponse.length > MAX_RESPONSE_CHARS ? `${params.thumbedDownResponse.slice(0, MAX_RESPONSE_CHARS)}...` : params.thumbedDownResponse;
30
+ const truncated = params.thumbedDownResponse.length > MAX_RESPONSE_CHARS ? `${truncateUtf16Safe(params.thumbedDownResponse, MAX_RESPONSE_CHARS)}...` : params.thumbedDownResponse;
30
31
  parts.push(`\nYour response was:\n> ${truncated}`);
31
32
  }
32
33
  if (params.userComment) parts.push(`\nUser's comment: "${params.userComment}"`);
@@ -350,6 +351,35 @@ function wasMSTeamsBotMentioned(activity) {
350
351
  return (activity.entities ?? []).some((e) => e.type === "mention" && e.mentioned?.id === botId);
351
352
  }
352
353
  //#endregion
354
+ //#region extensions/msteams/src/adaptive-card-submit.ts
355
+ function extractAdaptiveCardSubmittedData(value) {
356
+ if (!isRecord(value)) return value;
357
+ const action = isRecord(value.action) ? value.action : void 0;
358
+ if (action && normalizeOptionalLowercaseString(action.type) === "action.submit" && "data" in action) return action.data;
359
+ return value;
360
+ }
361
+ function readMSTeamsImBackValue(value) {
362
+ if (!isRecord(value)) return null;
363
+ const msteams = isRecord(value.msteams) ? value.msteams : void 0;
364
+ if (!msteams || normalizeOptionalLowercaseString(msteams.type) !== "imback") return null;
365
+ return normalizeOptionalString(msteams.value) ?? null;
366
+ }
367
+ function serializeMSTeamsAdaptiveCardActionValue(value) {
368
+ const submittedValue = extractAdaptiveCardSubmittedData(value);
369
+ if (typeof submittedValue === "string") {
370
+ const trimmed = submittedValue.trim();
371
+ return trimmed ? trimmed : null;
372
+ }
373
+ const imBackValue = readMSTeamsImBackValue(submittedValue);
374
+ if (imBackValue) return imBackValue;
375
+ if (submittedValue == null) return null;
376
+ try {
377
+ return JSON.stringify(submittedValue);
378
+ } catch {
379
+ return null;
380
+ }
381
+ }
382
+ //#endregion
353
383
  //#region extensions/msteams/src/monitor-handler/access.ts
354
384
  const msteamsIngressIdentity = {
355
385
  key: "sender-id",
@@ -1326,7 +1356,7 @@ function resolveTeamGroupIdCacheExpiresAt(nowRaw = Date.now()) {
1326
1356
  function stripHtmlFromTeamsMessage(html) {
1327
1357
  let text = html.replace(/<at[^>]*>(.*?)<\/at>/gi, "@$1");
1328
1358
  text = text.replace(/<[^>]*>/g, " ");
1329
- text = text.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#39;/g, "'").replace(/&nbsp;/g, " ");
1359
+ text = text.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, "\"").replace(/&#39;/g, "'").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&");
1330
1360
  return text.replace(/\s+/g, " ").trim();
1331
1361
  }
1332
1362
  /**
@@ -1466,7 +1496,7 @@ function summarizeParentMessage(message) {
1466
1496
  if (!text) return;
1467
1497
  return {
1468
1498
  sender,
1469
- text: text.length > PARENT_TEXT_MAX_CHARS ? `${text.slice(0, PARENT_TEXT_MAX_CHARS - 1)}…` : text
1499
+ text: text.length > PARENT_TEXT_MAX_CHARS ? `${truncateUtf16Safe(text, PARENT_TEXT_MAX_CHARS - 1)}…` : text
1470
1500
  };
1471
1501
  }
1472
1502
  /**
@@ -2327,8 +2357,8 @@ function createMSTeamsMessageHandler(deps) {
2327
2357
  const attachmentTypes = attachments.map((att) => typeof att.contentType === "string" ? att.contentType : void 0).filter(Boolean).slice(0, 3);
2328
2358
  const htmlSummary = summarizeMSTeamsHtmlAttachments(attachments);
2329
2359
  log.info("received message", {
2330
- rawText: rawText.slice(0, 50),
2331
- text: text.slice(0, 50),
2360
+ rawText: truncateUtf16Safe(rawText, 50),
2361
+ text: truncateUtf16Safe(text, 50),
2332
2362
  attachments: attachments.length,
2333
2363
  attachmentTypes,
2334
2364
  from: from?.id,
@@ -2512,7 +2542,7 @@ function createMSTeamsMessageHandler(deps) {
2512
2542
  conversationMessageId,
2513
2543
  replyToId: activity.replyToId
2514
2544
  });
2515
- const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
2545
+ const preview = sliceUtf16Safe(rawBody.replace(/\s+/g, " "), 0, 160);
2516
2546
  const inboundLabel = isDirectMessage ? `Teams DM from ${senderName}` : `Teams message in ${conversationType} from ${senderName}`;
2517
2547
  const enqueuePrimaryMessageSystemEvent = () => core.system.enqueueSystemEvent(inboundLabel, {
2518
2548
  sessionKey: route.sessionKey,
@@ -2884,7 +2914,8 @@ function createMSTeamsMessageHandler(deps) {
2884
2914
  const attachments = Array.isArray(activity.attachments) ? activity.attachments : [];
2885
2915
  const rawText = activity.text?.trim() ?? "";
2886
2916
  const htmlText = extractTextFromHtmlAttachments(attachments);
2887
- const text = stripMSTeamsMentionTags(rawText || htmlText);
2917
+ const valueText = rawText || htmlText ? "" : serializeMSTeamsAdaptiveCardActionValue(activity.value);
2918
+ const text = stripMSTeamsMentionTags(rawText || htmlText || valueText || "");
2888
2919
  const wasMentioned = wasMSTeamsBotMentioned(activity);
2889
2920
  const conversationId = normalizeMSTeamsConversationId(activity.conversation?.id ?? "");
2890
2921
  const replyToId = activity.replyToId ?? void 0;
@@ -3011,8 +3042,8 @@ function buildWelcomeCard(options) {
3011
3042
  body: [{
3012
3043
  type: "TextBlock",
3013
3044
  text: `Hi! I'm ${botName}.`,
3014
- weight: "bolder",
3015
- size: "medium"
3045
+ weight: "Bolder",
3046
+ size: "Medium"
3016
3047
  }, {
3017
3048
  type: "TextBlock",
3018
3049
  text: "I can help you with questions, tasks, and more. Here are some things to try:",
@@ -3037,33 +3068,6 @@ function buildGroupWelcomeText(botName) {
3037
3068
  }
3038
3069
  //#endregion
3039
3070
  //#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
- }
3052
- function serializeAdaptiveCardActionValue(value) {
3053
- const submittedValue = extractAdaptiveCardSubmittedData(value);
3054
- if (typeof submittedValue === "string") {
3055
- const trimmed = submittedValue.trim();
3056
- return trimmed ? trimmed : null;
3057
- }
3058
- const imBackValue = readMSTeamsImBackValue(submittedValue);
3059
- if (imBackValue) return imBackValue;
3060
- if (submittedValue == null) return null;
3061
- try {
3062
- return JSON.stringify(submittedValue);
3063
- } catch {
3064
- return null;
3065
- }
3066
- }
3067
3071
  async function isInvokeAuthorized(params) {
3068
3072
  const { context, deps, deniedLogs, includeInvokeName = false } = params;
3069
3073
  const resolved = await resolveMSTeamsSenderAccess({
@@ -3142,7 +3146,7 @@ function registerMSTeamsHandlers(handler, deps) {
3142
3146
  if (originalRun) handler.run = async (context) => {
3143
3147
  const ctx = context;
3144
3148
  if (ctx.activity?.type === "invoke" && ctx.activity?.name === "adaptiveCard/action") {
3145
- const text = serializeAdaptiveCardActionValue(ctx.activity?.value);
3149
+ const text = serializeMSTeamsAdaptiveCardActionValue(ctx.activity?.value);
3146
3150
  if (text) await handleTeamsMessage({
3147
3151
  ...ctx,
3148
3152
  activity: {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/msteams",
3
- "version": "2026.6.11-beta.2",
3
+ "version": "2026.7.1-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/msteams",
9
- "version": "2026.6.11-beta.2",
9
+ "version": "2026.7.1-beta.1",
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.11-beta.2"
18
+ "openclaw": ">=2026.7.1-beta.1"
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.6.11-beta.2",
3
+ "version": "2026.7.1-beta.1",
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.11-beta.2"
18
+ "openclaw": ">=2026.7.1-beta.1"
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.11-beta.2"
54
+ "pluginApi": ">=2026.7.1-beta.1"
55
55
  },
56
56
  "build": {
57
- "openclawVersion": "2026.6.11-beta.2"
57
+ "openclawVersion": "2026.7.1-beta.1"
58
58
  },
59
59
  "release": {
60
60
  "publishToClawHub": true,