@openclaw/msteams 2026.9.5 → 2026.9.7

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.
Files changed (33) hide show
  1. package/assets/icon.png +0 -0
  2. package/dist/.setup/{adapter.runtime-ChuVK6k_.cjs → adapter.runtime-BiWeMKXE.cjs} +24 -30
  3. package/dist/.setup/{approval-card-CPNH_q3P.cjs → approval-card-DWPDItvq.cjs} +6 -3
  4. package/dist/.setup/{approval-handler.runtime-DDxGPJDz.cjs → approval-handler.runtime-D1s7UR3U.cjs} +4 -4
  5. package/dist/.setup/bot-framework-service-url-BUhTe8F3.cjs +55 -0
  6. package/dist/.setup/{channel-Dzpbbht8.cjs → channel-ByzS7QJ0.cjs} +338 -220
  7. package/dist/.setup/{channel.runtime-TE49QvFv.cjs → channel.runtime-Baz8XDFs.cjs} +47 -144
  8. package/dist/.setup/{channel.setup-BVDfgdCc.cjs → channel.setup-DL8lcWT_.cjs} +6 -6
  9. package/dist/.setup/{config-schema-D22Lr1Qk.cjs → config-schema-0KoBzb0t.cjs} +24 -38
  10. package/dist/.setup/{messenger-BR1l4zw-.cjs → conversation-store-state-B7JuyZTm.cjs} +697 -297
  11. package/dist/.setup/{src-CpKfpP1m.cjs → monitor-BJ7IyH4y.cjs} +440 -663
  12. package/dist/.setup/{oauth-C6m7dvHj.cjs → oauth-DQjOnJ4l.cjs} +1 -1
  13. package/dist/.setup/{reaction-types-C7RA7Wxt.cjs → reaction-types-CQ4oSUe7.cjs} +2 -6
  14. package/dist/.setup/{resolve-allowlist-CHzaaWiC.cjs → resolve-allowlist-Pl_NQFYH.cjs} +55 -312
  15. package/dist/.setup/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-BloeesfJ.cjs} +22 -0
  16. package/dist/.setup/{send-D8ATH4QI.cjs → send-VUM7Sryb.cjs} +47 -97
  17. package/dist/.setup/{setup-plugin-api-DpiaA8z1.cjs → setup-plugin-api-Dyf8kF-l.cjs} +1 -1
  18. package/dist/.setup/{thread-session-CXgHK-yi.cjs → thread-session--rw3BTal.cjs} +2 -5
  19. package/dist/api.cjs +2 -2
  20. package/dist/channel-config-api.cjs +1 -1
  21. package/dist/channel-plugin-api.cjs +1 -1
  22. package/dist/configured-state.cjs +0 -1
  23. package/dist/directory-contract-api.cjs +1 -1
  24. package/dist/doctor-contract-api.cjs +201 -371
  25. package/dist/qa-runner-api.cjs +1 -1
  26. package/dist/runtime-api.cjs +0 -6
  27. package/dist/setup-entry.cjs +1 -1
  28. package/dist/setup-plugin-api.cjs +1 -1
  29. package/openclaw.plugin.json +46 -5
  30. package/package.json +10 -10
  31. package/dist/.setup/polls-BJ4-4uZm.cjs +0 -668
  32. package/dist/.setup/secret-input-C65t6kjM.cjs +0 -1
  33. package/dist/.setup/sso-token-store-YYLHXgFH.cjs +0 -111
@@ -5,6 +5,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
8
17
  var __copyProps = (to, from, except, desc) => {
9
18
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
19
  key = keys[i];
@@ -15,11 +24,24 @@ var __copyProps = (to, from, except, desc) => {
15
24
  }
16
25
  return to;
17
26
  };
27
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
28
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
29
  value: mod,
20
30
  enumerable: true
21
31
  }) : target, mod));
22
32
  //#endregion
33
+ Object.defineProperty(exports, "__exportAll", {
34
+ enumerable: true,
35
+ get: function() {
36
+ return __exportAll;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "__reExport", {
40
+ enumerable: true,
41
+ get: function() {
42
+ return __reExport;
43
+ }
44
+ });
23
45
  Object.defineProperty(exports, "__toESM", {
24
46
  enumerable: true,
25
47
  get: function() {
@@ -1,10 +1,10 @@
1
1
  const require_runtime = require("./runtime-gZTAuFux.cjs");
2
2
  require("../runtime-api.cjs");
3
- const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
4
- const require_channel = require("./channel-Dzpbbht8.cjs");
5
- const require_channel_setup = require("./channel.setup-BVDfgdCc.cjs");
6
- const require_polls = require("./polls-BJ4-4uZm.cjs");
7
- const require_messenger = require("./messenger-BR1l4zw-.cjs");
3
+ const require_resolve_allowlist = require("./resolve-allowlist-Pl_NQFYH.cjs");
4
+ const require_bot_framework_service_url = require("./bot-framework-service-url-BUhTe8F3.cjs");
5
+ const require_channel = require("./channel-ByzS7QJ0.cjs");
6
+ const require_channel_setup = require("./channel.setup-DL8lcWT_.cjs");
7
+ const require_conversation_store_state = require("./conversation-store-state-B7JuyZTm.cjs");
8
8
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
9
9
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
10
10
  let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
@@ -67,24 +67,19 @@ function parseRecipient(to) {
67
67
  if (trimmed.startsWith("19:") || trimmed.includes("@thread")) return finalize("conversation", trimmed);
68
68
  return finalize("user", trimmed);
69
69
  }
70
- /**
71
- * Find a stored conversation reference for the given recipient.
72
- */
73
70
  async function findConversationReference(recipient) {
74
71
  if (recipient.type === "conversation") {
75
72
  const ref = await recipient.store.get(recipient.id);
76
- if (ref) return {
73
+ return ref ? {
77
74
  conversationId: recipient.id,
78
75
  ref
79
- };
80
- return null;
76
+ } : null;
81
77
  }
82
78
  const found = await recipient.store.findPreferredDmByUserId(recipient.id);
83
- if (!found) return null;
84
- return {
79
+ return found ? {
85
80
  conversationId: found.conversationId,
86
81
  ref: found.reference
87
- };
82
+ } : null;
88
83
  }
89
84
  async function resolveMSTeamsSendContext(params) {
90
85
  const msteamsCfg = params.cfg.channels?.msteams;
@@ -94,7 +89,7 @@ async function resolveMSTeamsSendContext(params) {
94
89
  if (!account.configured) throw new Error("msteams credentials not configured");
95
90
  const creds = require_resolve_allowlist.resolveMSTeamsCredentials(msteamsCfg);
96
91
  if (!creds) throw new Error("msteams credentials not configured");
97
- const store = require_polls.createMSTeamsConversationStoreState();
92
+ const store = require_conversation_store_state.createMSTeamsConversationStoreState();
98
93
  const recipient = parseRecipient(params.to);
99
94
  const found = await findConversationReference({
100
95
  ...recipient,
@@ -107,7 +102,7 @@ async function resolveMSTeamsSendContext(params) {
107
102
  threadId: recipient.threadId
108
103
  } : found.ref;
109
104
  const log = require_runtime.getMSTeamsRuntime().logging.getChildLogger({ name: "msteams:send" });
110
- if (ref.serviceUrl && !require_resolve_allowlist.isAllowedBotFrameworkServiceUrl(ref.serviceUrl)) {
105
+ if (ref.serviceUrl && !require_bot_framework_service_url.isAllowedBotFrameworkServiceUrl(ref.serviceUrl)) {
111
106
  try {
112
107
  await store.remove(conversationId);
113
108
  } catch (err) {
@@ -116,11 +111,11 @@ async function resolveMSTeamsSendContext(params) {
116
111
  error: require_channel_setup.formatUnknownError(err)
117
112
  });
118
113
  }
119
- throw new Error(`Stored Microsoft Teams conversation reference has blocked serviceUrl host: ${require_resolve_allowlist.describeBotFrameworkServiceUrlHost(ref.serviceUrl)}. The bot must receive a new message from this conversation before it can send proactively.`);
114
+ throw new Error(`Stored Microsoft Teams conversation reference has blocked serviceUrl host: ${require_bot_framework_service_url.describeBotFrameworkServiceUrlHost(ref.serviceUrl)}. The bot must receive a new message from this conversation before it can send proactively.`);
120
115
  }
121
116
  const safeRef = ref.serviceUrl ? {
122
117
  ...ref,
123
- serviceUrl: require_resolve_allowlist.normalizeBotFrameworkServiceUrl(ref.serviceUrl)
118
+ serviceUrl: require_bot_framework_service_url.normalizeBotFrameworkServiceUrl(ref.serviceUrl)
124
119
  } : ref;
125
120
  if (recipient.type === "user") {
126
121
  const resolvedType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(safeRef.conversation?.conversationType ?? "");
@@ -136,10 +131,7 @@ async function resolveMSTeamsSendContext(params) {
136
131
  });
137
132
  const tokenProvider = require_resolve_allowlist.createMSTeamsTokenProvider(app);
138
133
  const storedConversationType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(safeRef.conversation?.conversationType ?? "");
139
- let conversationType;
140
- if (storedConversationType === "personal") conversationType = "personal";
141
- else if (storedConversationType === "channel") conversationType = "channel";
142
- else conversationType = "groupChat";
134
+ const conversationType = storedConversationType === "personal" || storedConversationType === "channel" ? storedConversationType : "groupChat";
143
135
  const replyTarget = recipient.threadId && conversationType === "channel" ? {
144
136
  replyStyle: "thread",
145
137
  threadActivityId: recipient.threadId
@@ -149,7 +141,6 @@ async function resolveMSTeamsSendContext(params) {
149
141
  ref: safeRef,
150
142
  conversationType
151
143
  });
152
- const sharePointSiteId = msteamsCfg.sharePointSiteId;
153
144
  const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
154
145
  cfg: params.cfg,
155
146
  resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
@@ -164,13 +155,12 @@ async function resolveMSTeamsSendContext(params) {
164
155
  ...replyTarget,
165
156
  sdkCloudOptions,
166
157
  tokenProvider,
167
- sharePointSiteId,
158
+ sharePointSiteId: msteamsCfg.sharePointSiteId,
168
159
  mediaMaxBytes
169
160
  };
170
161
  }
171
162
  //#endregion
172
163
  //#region extensions/msteams/src/send.ts
173
- /** Threshold for large files that require FileConsentCard flow in personal chats */
174
164
  const FILE_CONSENT_THRESHOLD_BYTES = 4194304;
175
165
  /**
176
166
  * MSTeams-specific media size limit (100MB).
@@ -208,22 +198,8 @@ function createMSTeamsSendReceipt(params) {
208
198
  conversationId: params.conversationId
209
199
  }))
210
200
  });
211
- if (!params.kinds) return receipt;
212
- const kinds = params.kinds;
213
- return {
214
- ...receipt,
215
- parts: receipt.parts.map((part, index) => {
216
- const nextPart = {
217
- platformMessageId: part.platformMessageId,
218
- kind: kinds[index] ?? params.kind,
219
- index: part.index
220
- };
221
- if (part.threadId) nextPart.threadId = part.threadId;
222
- if (part.replyToId) nextPart.replyToId = part.replyToId;
223
- if (part.raw) nextPart.raw = part.raw;
224
- return nextPart;
225
- })
226
- };
201
+ if (params.kinds) for (const [index, part] of receipt.parts.entries()) part.kind = params.kinds[index] ?? params.kind;
202
+ return receipt;
227
203
  }
228
204
  function createMSTeamsSendResult(params) {
229
205
  const platformMessageIds = (params.platformMessageIds?.length ? [...params.platformMessageIds] : [params.messageId]).map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown");
@@ -256,7 +232,7 @@ async function sendMessageMSTeams(params) {
256
232
  cfg,
257
233
  channel: "msteams"
258
234
  });
259
- const messageText = require_messenger.formatMSTeamsMarkdown(text ?? "", tableMode);
235
+ const messageText = require_conversation_store_state.formatMSTeamsMarkdown(text ?? "", tableMode);
260
236
  const ctx = await resolveMSTeamsSendContext({
261
237
  cfg,
262
238
  to
@@ -278,7 +254,7 @@ async function sendMessageMSTeams(params) {
278
254
  });
279
255
  const isLargeFile = media.buffer.length >= FILE_CONSENT_THRESHOLD_BYTES;
280
256
  const isImage = media.contentType?.startsWith("image/") ?? false;
281
- const fallbackFileName = await require_messenger.extractFilename(mediaUrl);
257
+ const fallbackFileName = await require_conversation_store_state.extractFilename(mediaUrl);
282
258
  const fileName = filename?.trim() || media.fileName || fallbackFileName;
283
259
  log.debug?.("processing media", {
284
260
  fileName,
@@ -288,14 +264,14 @@ async function sendMessageMSTeams(params) {
288
264
  isImage,
289
265
  conversationType
290
266
  });
291
- if (require_messenger.requiresFileConsent({
267
+ if (require_conversation_store_state.requiresFileConsent({
292
268
  conversationType,
293
269
  contentType: media.contentType,
294
270
  bufferSize: media.buffer.length,
295
271
  thresholdBytes: FILE_CONSENT_THRESHOLD_BYTES
296
272
  })) {
297
273
  require_resolve_allowlist.assertMSTeamsSendHandoff(params);
298
- const { activity, uploadId } = await require_messenger.prepareFileConsentActivityFs({
274
+ const { activity, uploadId } = await require_conversation_store_state.prepareFileConsentActivityFs({
299
275
  media: {
300
276
  buffer: media.buffer,
301
277
  filename: fileName,
@@ -323,11 +299,11 @@ async function sendMessageMSTeams(params) {
323
299
  pendingUploadId: uploadId
324
300
  });
325
301
  return finishMSTeamsSend(result, async () => {
326
- require_messenger.setPendingUploadActivityId(uploadId, messageId);
302
+ require_conversation_store_state.setPendingUploadActivityId(uploadId, messageId);
327
303
  try {
328
304
  await params.onDeliveryResult?.(result);
329
305
  } finally {
330
- await require_messenger.setPendingUploadActivityIdFs(uploadId, messageId);
306
+ await require_conversation_store_state.setPendingUploadActivityIdFs(uploadId, messageId);
331
307
  }
332
308
  log.info("sent file consent card", {
333
309
  conversationId,
@@ -336,22 +312,18 @@ async function sendMessageMSTeams(params) {
336
312
  });
337
313
  });
338
314
  }
339
- if (conversationType === "personal") {
340
- const base64 = media.buffer.toString("base64");
341
- return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`, params);
342
- }
343
- if (isImage && !sharePointSiteId) {
315
+ if (conversationType === "personal" || isImage && !sharePointSiteId) {
344
316
  const base64 = media.buffer.toString("base64");
345
317
  return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`, params);
346
318
  }
347
319
  try {
348
- const siteId = require_messenger.requireMSTeamsSharePointSiteId(sharePointSiteId);
320
+ const siteId = require_conversation_store_state.requireMSTeamsSharePointSiteId(sharePointSiteId);
349
321
  log.debug?.("uploading to SharePoint for native file card", {
350
322
  fileName,
351
323
  conversationType,
352
324
  siteId
353
325
  });
354
- const uploaded = await require_messenger.uploadAndShareSharePoint({
326
+ const uploaded = await require_conversation_store_state.uploadAndShareSharePoint({
355
327
  assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
356
328
  buffer: media.buffer,
357
329
  filename: fileName,
@@ -365,7 +337,7 @@ async function sendMessageMSTeams(params) {
365
337
  itemId: uploaded.itemId,
366
338
  shareUrl: uploaded.shareUrl
367
339
  });
368
- const driveItem = await require_messenger.getDriveItemProperties({
340
+ const driveItem = await require_conversation_store_state.getDriveItemProperties({
369
341
  assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
370
342
  siteId,
371
343
  itemId: uploaded.itemId,
@@ -375,11 +347,11 @@ async function sendMessageMSTeams(params) {
375
347
  eTag: driveItem.eTag,
376
348
  webDavUrl: driveItem.webDavUrl
377
349
  });
378
- const fileCardAttachment = require_messenger.buildTeamsFileInfoCard(driveItem);
350
+ const fileCardAttachment = require_conversation_store_state.buildTeamsFileInfoCard(driveItem);
379
351
  const messageId = await sendProactiveActivityRaw({
380
352
  ctx,
381
353
  activity: {
382
- ...require_messenger.buildMSTeamsMessageActivity(messageText || void 0),
354
+ ...require_conversation_store_state.buildMSTeamsMessageActivity(messageText || void 0),
383
355
  attachments: [fileCardAttachment]
384
356
  },
385
357
  assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
@@ -404,9 +376,6 @@ async function sendMessageMSTeams(params) {
404
376
  }
405
377
  return sendTextWithMedia(ctx, messageText, void 0, params);
406
378
  }
407
- /**
408
- * Send a text message with optional base64 media URL.
409
- */
410
379
  async function sendTextWithMedia(ctx, text, mediaUrl, options) {
411
380
  const { app, appId, conversationId, ref, log, tokenProvider, sharePointSiteId, mediaMaxBytes, replyStyle } = ctx;
412
381
  const messages = text && mediaUrl ? [{ text }, { mediaUrl }] : [{
@@ -417,7 +386,7 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
417
386
  const acceptedIds = [];
418
387
  const acceptedKinds = [];
419
388
  try {
420
- platformMessageIds = await require_messenger.sendMSTeamsMessages({
389
+ platformMessageIds = await require_conversation_store_state.sendMSTeamsMessages({
421
390
  assertDirectAdapterHandoff: options.assertDirectAdapterHandoff,
422
391
  onPlatformSendDispatch: options.onPlatformSendDispatch,
423
392
  onMessageSent: async (messageId, messageIndex) => {
@@ -474,14 +443,14 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
474
443
  };
475
444
  }
476
445
  async function sendProactiveActivityRaw({ ctx, activity, assertDirectAdapterHandoff, onPlatformSendDispatch }) {
477
- const baseRef = require_messenger.buildConversationReference(ctx.ref);
478
- const response = await require_messenger.sendMSTeamsActivityWithReference(ctx.app, baseRef, activity, {
446
+ const baseRef = require_conversation_store_state.buildConversationReference(ctx.ref);
447
+ const response = await require_conversation_store_state.sendMSTeamsActivityWithReference(ctx.app, baseRef, activity, {
479
448
  assertDirectAdapterHandoff,
480
449
  onPlatformSendDispatch,
481
450
  ...ctx.threadActivityId ? { threadActivityId: ctx.threadActivityId } : {},
482
451
  serviceUrlBoundary: ctx.sdkCloudOptions
483
452
  });
484
- return require_messenger.extractMessageId(response) ?? "unknown";
453
+ return require_conversation_store_state.extractMessageId(response) ?? "unknown";
485
454
  }
486
455
  async function sendProactiveActivity(params) {
487
456
  try {
@@ -490,17 +459,15 @@ async function sendProactiveActivity(params) {
490
459
  throw createMSTeamsSendError(params.errorPrefix, err);
491
460
  }
492
461
  }
493
- /**
494
- * Send a poll (Adaptive Card) to a Teams conversation or user.
495
- */
496
462
  async function sendPollMSTeams(params) {
463
+ require_resolve_allowlist.assertMSTeamsSendHandoff(params);
497
464
  const { cfg, to, question, options, maxSelections } = params;
498
465
  const ctx = await resolveMSTeamsSendContext({
499
466
  cfg,
500
467
  to
501
468
  });
502
469
  const { conversationId, log } = ctx;
503
- const pollCard = require_polls.buildMSTeamsPollCard({
470
+ const pollCard = require_conversation_store_state.buildMSTeamsPollCard({
504
471
  question,
505
472
  options,
506
473
  maxSelections
@@ -512,14 +479,10 @@ async function sendPollMSTeams(params) {
512
479
  });
513
480
  const messageId = await sendProactiveActivity({
514
481
  ctx,
515
- activity: {
516
- type: "message",
517
- attachments: [{
518
- contentType: "application/vnd.microsoft.card.adaptive",
519
- content: pollCard.card
520
- }]
521
- },
522
- errorPrefix: "msteams poll send"
482
+ activity: require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(pollCard.card),
483
+ errorPrefix: "msteams poll send",
484
+ assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
485
+ onPlatformSendDispatch: params.onPlatformSendDispatch
523
486
  });
524
487
  log.info("sent poll", {
525
488
  conversationId,
@@ -532,9 +495,6 @@ async function sendPollMSTeams(params) {
532
495
  conversationId
533
496
  };
534
497
  }
535
- /**
536
- * Send an arbitrary Adaptive Card to a Teams conversation or user.
537
- */
538
498
  async function sendAdaptiveCardMSTeams(params) {
539
499
  require_resolve_allowlist.assertMSTeamsSendHandoff(params);
540
500
  const { cfg, to, card } = params;
@@ -550,13 +510,7 @@ async function sendAdaptiveCardMSTeams(params) {
550
510
  });
551
511
  const messageId = await sendProactiveActivity({
552
512
  ctx,
553
- activity: {
554
- type: "message",
555
- attachments: [{
556
- contentType: "application/vnd.microsoft.card.adaptive",
557
- content: card
558
- }]
559
- },
513
+ activity: require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(card),
560
514
  errorPrefix: "msteams card send",
561
515
  assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
562
516
  onPlatformSendDispatch: params.onPlatformSendDispatch
@@ -584,7 +538,7 @@ async function editMessageMSTeams(params) {
584
538
  return updateMSTeamsMessageActivity({
585
539
  ...params,
586
540
  activity: {
587
- ...require_messenger.buildMSTeamsMessageActivity(require_messenger.formatMSTeamsMarkdown(params.text, (0, openclaw_plugin_sdk_markdown_table_runtime.resolveMarkdownTableMode)({
541
+ ...require_conversation_store_state.buildMSTeamsMessageActivity(require_conversation_store_state.formatMSTeamsMarkdown(params.text, (0, openclaw_plugin_sdk_markdown_table_runtime.resolveMarkdownTableMode)({
588
542
  cfg: params.cfg,
589
543
  channel: "msteams"
590
544
  }))),
@@ -596,12 +550,8 @@ async function editAdaptiveCardMSTeams(params) {
596
550
  return updateMSTeamsMessageActivity({
597
551
  ...params,
598
552
  activity: {
599
- type: "message",
600
- id: params.activityId,
601
- attachments: [{
602
- contentType: "application/vnd.microsoft.card.adaptive",
603
- content: params.card
604
- }]
553
+ ...require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(params.card),
554
+ id: params.activityId
605
555
  }
606
556
  });
607
557
  }
@@ -616,8 +566,8 @@ async function updateMSTeamsMessageActivity(params) {
616
566
  activityId
617
567
  });
618
568
  try {
619
- const baseRef = require_messenger.buildConversationReference(ref);
620
- await require_messenger.updateMSTeamsActivityWithReference(app, baseRef, activityId, activity, { serviceUrlBoundary: sdkCloudOptions });
569
+ const baseRef = require_conversation_store_state.buildConversationReference(ref);
570
+ await require_conversation_store_state.updateMSTeamsActivityWithReference(app, baseRef, activityId, activity, { serviceUrlBoundary: sdkCloudOptions });
621
571
  } catch (err) {
622
572
  throw createMSTeamsSendError("msteams edit", err);
623
573
  }
@@ -644,8 +594,8 @@ async function deleteMessageMSTeams(params) {
644
594
  activityId
645
595
  });
646
596
  try {
647
- const baseRef = require_messenger.buildConversationReference(ref);
648
- await require_messenger.deleteMSTeamsActivityWithReference(app, baseRef, activityId, { serviceUrlBoundary: sdkCloudOptions });
597
+ const baseRef = require_conversation_store_state.buildConversationReference(ref);
598
+ await require_conversation_store_state.deleteMSTeamsActivityWithReference(app, baseRef, activityId, { serviceUrlBoundary: sdkCloudOptions });
649
599
  } catch (err) {
650
600
  throw createMSTeamsSendError("msteams delete", err);
651
601
  }
@@ -1,3 +1,3 @@
1
- const require_channel_setup = require("./channel.setup-BVDfgdCc.cjs");
1
+ const require_channel_setup = require("./channel.setup-DL8lcWT_.cjs");
2
2
  require("../setup-plugin-api.cjs");
3
3
  exports.msteamsSetupPlugin = require_channel_setup.msteamsSetupPlugin;
@@ -1,4 +1,4 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-CHzaaWiC.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-Pl_NQFYH.cjs");
2
2
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
3
3
  let openclaw_plugin_sdk_approval_auth_runtime = require("openclaw/plugin-sdk/approval-auth-runtime");
4
4
  let openclaw_plugin_sdk_routing = require("openclaw/plugin-sdk/routing");
@@ -9,13 +9,10 @@ function normalizeMSTeamsApproverId(value) {
9
9
  const id = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalLowercaseString)(normalized?.startsWith("user:") ? normalized.slice(5) : normalized);
10
10
  return id && MSTEAMS_ID_RE.test(id) ? id : void 0;
11
11
  }
12
- function resolveMSTeamsChannelConfig(cfg) {
13
- return cfg.channels?.msteams;
14
- }
15
12
  const msTeamsApproval = (0, openclaw_plugin_sdk_approval_auth_runtime.createChannelApprovalAuth)({
16
13
  channelLabel: "Microsoft Teams",
17
14
  resolveInputs: ({ cfg }) => {
18
- const channel = resolveMSTeamsChannelConfig(cfg);
15
+ const channel = cfg.channels?.msteams;
19
16
  return {
20
17
  allowFrom: channel?.allowFrom,
21
18
  defaultTo: channel?.defaultTo
package/dist/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_channel = require("./.setup/channel-Dzpbbht8.cjs");
3
- const require_channel_setup = require("./.setup/channel.setup-BVDfgdCc.cjs");
2
+ const require_channel = require("./.setup/channel-ByzS7QJ0.cjs");
3
+ const require_channel_setup = require("./.setup/channel.setup-DL8lcWT_.cjs");
4
4
  exports.createMSTeamsSetupWizardBase = require_channel_setup.createMSTeamsSetupWizardBase;
5
5
  exports.msteamsPlugin = require_channel.msteamsPlugin;
6
6
  exports.msteamsSetupAdapter = require_channel_setup.msteamsSetupAdapter;
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_config_schema = require("./.setup/config-schema-D22Lr1Qk.cjs");
2
+ const require_config_schema = require("./.setup/config-schema-0KoBzb0t.cjs");
3
3
  exports.MSTeamsChannelConfigSchema = require_config_schema.MSTeamsChannelConfigSchema;
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_channel = require("./.setup/channel-Dzpbbht8.cjs");
2
+ const require_channel = require("./.setup/channel-ByzS7QJ0.cjs");
3
3
  exports.msteamsPlugin = require_channel.msteamsPlugin;
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- require("./.setup/secret-input-C65t6kjM.cjs");
3
2
  let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
4
3
  //#region extensions/msteams/configured-state.ts
5
4
  /** Mirror Teams auth-mode requirements without loading the Azure SDK or full channel. */
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_resolve_allowlist = require("./.setup/resolve-allowlist-CHzaaWiC.cjs");
2
+ const require_resolve_allowlist = require("./.setup/resolve-allowlist-Pl_NQFYH.cjs");
3
3
  let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
4
4
  const msteamsDirectoryContractPlugin = {
5
5
  id: "msteams",