@openclaw/msteams 2026.10.10-beta.5 → 2026.10.10

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 (37) hide show
  1. package/dist/.setup/{adapter.runtime-B-6Q3nMI.cjs → adapter.runtime-BMvpm7sS.cjs} +3 -5
  2. package/dist/.setup/{approval-card-DWPDItvq.cjs → approval-card-Bo8kHYbj.cjs} +2 -4
  3. package/dist/.setup/{approval-handler.runtime-CGIr9ItR.cjs → approval-handler.runtime-BS3avHFu.cjs} +5 -6
  4. package/dist/.setup/{bot-framework-service-url-B3FWn2SV.cjs → bot-framework-service-url-CgVuKiIR.cjs} +2 -4
  5. package/dist/.setup/{channel-Du4L0JEh.cjs → channel-CdCSk3Rg.cjs} +27 -47
  6. package/dist/.setup/{channel.runtime-3-5Ty0Vy.cjs → channel.runtime--ZjTYgkY.cjs} +17 -26
  7. package/dist/.setup/{channel.setup-BN3uhq3r.cjs → channel.setup-nSTtK77J.cjs} +11 -17
  8. package/dist/.setup/{config-schema-CkKdphSp.cjs → config-schema-Bm15lF-j.cjs} +5 -8
  9. package/dist/.setup/{conversation-store-state-B-4g4uq5.cjs → conversation-store-state-NJU9osd-.cjs} +23 -40
  10. package/dist/.setup/{delegated-state-Bv5cWuec.cjs → delegated-state-CbMd3rIh.cjs} +4 -6
  11. package/dist/.setup/{monitor-DK0bsDpk.cjs → monitor-BxLDs5fk.cjs} +46 -81
  12. package/dist/.setup/{oauth-BBUQCwmq.cjs → oauth-B-Y5pNM4.cjs} +3 -5
  13. package/dist/.setup/{reaction-types-CwP5RVQB.cjs → reaction-types-BaL1EVBS.cjs} +3 -5
  14. package/dist/.setup/{resolve-allowlist-gI34MnpE.cjs → resolve-allowlist-CqNzS9bZ.cjs} +19 -34
  15. package/dist/.setup/{rolldown-runtime-BloeesfJ.cjs → rolldown-runtime-CiKaZLfC.cjs} +1 -2
  16. package/dist/.setup/{runtime-gZTAuFux.cjs → runtime-CbKazLGv.cjs} +1 -2
  17. package/dist/.setup/{secret-contract-api-YY3v6MP8.cjs → secret-contract-api-5aH1Fl_c.cjs} +1 -1
  18. package/dist/.setup/{secret-contract-api-wAyY5UHv.cjs → secret-contract-api-BOzdWSn9.cjs} +1 -2
  19. package/dist/.setup/{send-ZvscULyk.cjs → send-BXjI3ufq.cjs} +9 -11
  20. package/dist/.setup/{setup-plugin-api-B-NYBLkF.cjs → setup-plugin-api-lPpin6Gg.cjs} +1 -1
  21. package/dist/.setup/{thread-session-BWVCoYza.cjs → thread-session-DZMoCsSR.cjs} +3 -5
  22. package/dist/.setup/{token-config-bEpua_Q7.cjs → token-config-DTZ00Ibq.cjs} +1 -2
  23. package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -1
  24. package/dist/api.cjs +2 -2
  25. package/dist/channel-config-api.cjs +1 -1
  26. package/dist/channel-plugin-api.cjs +1 -1
  27. package/dist/configured-state.cjs +1 -2
  28. package/dist/directory-contract-api.cjs +1 -2
  29. package/dist/doctor-backup-resources.cjs +2 -3
  30. package/dist/doctor-contract-api.cjs +9 -15
  31. package/dist/index.cjs +1 -2
  32. package/dist/qa-runner-api.cjs +3 -5
  33. package/dist/runtime-api.cjs +1 -1
  34. package/dist/secret-contract-api.cjs +1 -1
  35. package/dist/setup-entry.cjs +3 -4
  36. package/dist/setup-plugin-api.cjs +1 -1
  37. package/package.json +4 -4
@@ -1,10 +1,10 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
2
- const require_bot_framework_service_url = require("./bot-framework-service-url-B3FWn2SV.cjs");
3
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
4
- const require_runtime = require("./runtime-gZTAuFux.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CiKaZLfC.cjs");
2
+ const require_bot_framework_service_url = require("./bot-framework-service-url-CgVuKiIR.cjs");
3
+ const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
4
+ const require_runtime = require("./runtime-CbKazLGv.cjs");
5
5
  require("../runtime-api.cjs");
6
- const require_delegated_state = require("./delegated-state-Bv5cWuec.cjs");
7
- const require_channel_setup = require("./channel.setup-BN3uhq3r.cjs");
6
+ const require_delegated_state = require("./delegated-state-CbMd3rIh.cjs");
7
+ const require_channel_setup = require("./channel.setup-nSTtK77J.cjs");
8
8
  let openclaw_plugin_sdk_lazy_runtime = require("openclaw/plugin-sdk/lazy-runtime");
9
9
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
10
10
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
@@ -33,7 +33,7 @@ let openclaw_plugin_sdk_web_media = require("openclaw/plugin-sdk/web-media");
33
33
  let openclaw_plugin_sdk_dedupe_runtime = require("openclaw/plugin-sdk/dedupe-runtime");
34
34
  let openclaw_plugin_sdk_plugin_state_runtime = require("openclaw/plugin-sdk/plugin-state-runtime");
35
35
  let openclaw_plugin_sdk_media_runtime = require("openclaw/plugin-sdk/media-runtime");
36
- //#region extensions/msteams/src/file-consent.ts
36
+ // extensions/msteams/src/file-consent.ts
37
37
  /**
38
38
  * Allowlist of domains that are valid targets for file consent uploads.
39
39
  * These are the Microsoft/SharePoint domains that Teams legitimately provides
@@ -132,8 +132,7 @@ async function uploadToConsentUrl(params) {
132
132
  await res.body?.cancel().catch(() => void 0);
133
133
  if (!res.ok) throw new Error(`File upload to consent URL failed: ${res.status} ${res.statusText}`);
134
134
  }
135
- //#endregion
136
- //#region extensions/msteams/src/pending-uploads-fs.ts
135
+ // extensions/msteams/src/pending-uploads-fs.ts
137
136
  /** TTL for persisted pending uploads (matches in-memory store). */
138
137
  const PENDING_UPLOAD_TTL_MS$1 = 3e5;
139
138
  /** Cap to avoid unbounded growth if a process crashes mid-flow. */
@@ -296,8 +295,7 @@ async function setPendingUploadActivityIdFs(id, activityId) {
296
295
  }));
297
296
  });
298
297
  }
299
- //#endregion
300
- //#region extensions/msteams/src/pending-uploads.ts
298
+ // extensions/msteams/src/pending-uploads.ts
301
299
  /**
302
300
  * In-memory storage for files awaiting user consent in the FileConsentCard flow.
303
301
  *
@@ -362,8 +360,7 @@ function setPendingUploadActivityId(uploadId, activityId) {
362
360
  const entry = pendingUploads.get(uploadId);
363
361
  if (entry) entry.consentCardActivityId = activityId;
364
362
  }
365
- //#endregion
366
- //#region extensions/msteams/src/file-consent-helpers.ts
363
+ // extensions/msteams/src/file-consent-helpers.ts
367
364
  const FILE_CONSENT_THRESHOLD_BYTES = 4194304;
368
365
  /** In-process replies keep consent bytes in memory; CLI sends use the persisted variant below. */
369
366
  function prepareFileConsentActivity(params) {
@@ -403,8 +400,7 @@ function requiresFileConsent(params) {
403
400
  const isLargeFile = params.bufferSize >= FILE_CONSENT_THRESHOLD_BYTES;
404
401
  return isPersonal && (isLargeFile || !isImage);
405
402
  }
406
- //#endregion
407
- //#region extensions/msteams/src/format.ts
403
+ // extensions/msteams/src/format.ts
408
404
  const ESCAPED_MARKDOWN_RE = /\\[\\`*_{}[\]()#+\-.!|>~]/gu;
409
405
  const MARKDOWN_ENTITY_RE = /&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]+);/giu;
410
406
  const TOKEN_END = "";
@@ -685,8 +681,7 @@ function formatMSTeamsMarkdown(markdown, tableMode) {
685
681
  }, MSTEAMS_FORMAT_CAPABILITIES);
686
682
  return protectedValues.reduce((text, { prefix, values }) => restoreTokens(text, prefix, values), restoreTokens(rendered, `${tokenPrefix}c`, codeRegions));
687
683
  }
688
- //#endregion
689
- //#region extensions/msteams/src/graph-chat.ts
684
+ // extensions/msteams/src/graph-chat.ts
690
685
  function buildTeamsFileInfoCard(file) {
691
686
  const rawETag = file.eTag;
692
687
  const uniqueId = rawETag.replace(/^["']|["']$/g, "").replace(/[{}]/g, "").split(",")[0] ?? rawETag;
@@ -699,8 +694,7 @@ function buildTeamsFileInfoCard(file) {
699
694
  fileType
700
695
  });
701
696
  }
702
- //#endregion
703
- //#region extensions/msteams/src/graph-upload.ts
697
+ // extensions/msteams/src/graph-upload.ts
704
698
  const GRAPH_ROOT = "https://graph.microsoft.com/v1.0";
705
699
  const GRAPH_BETA = "https://graph.microsoft.com/beta";
706
700
  const GRAPH_SCOPE = "https://graph.microsoft.com";
@@ -843,8 +837,7 @@ async function uploadAndShareSharePoint(params) {
843
837
  name: uploaded.name
844
838
  };
845
839
  }
846
- //#endregion
847
- //#region extensions/msteams/src/media-helpers.ts
840
+ // extensions/msteams/src/media-helpers.ts
848
841
  const MSTEAMS_MAX_MEDIA_BYTES = 104857600;
849
842
  async function getMimeType(url) {
850
843
  if (url.startsWith("data:")) {
@@ -889,8 +882,7 @@ function extractMessageId(response) {
889
882
  const { id } = response;
890
883
  return typeof id === "string" && id ? id : null;
891
884
  }
892
- //#endregion
893
- //#region extensions/msteams/src/mentions.ts
885
+ // extensions/msteams/src/mentions.ts
894
886
  /**
895
887
  * Check whether an ID looks like a valid Teams user/bot identifier.
896
888
  * Accepts:
@@ -933,8 +925,7 @@ function parseMentions(text) {
933
925
  entities
934
926
  };
935
927
  }
936
- //#endregion
937
- //#region extensions/msteams/src/message-activity.ts
928
+ // extensions/msteams/src/message-activity.ts
938
929
  const AI_GENERATED_ENTITY = {
939
930
  type: "https://schema.org/Message",
940
931
  "@type": "Message",
@@ -960,8 +951,7 @@ function buildMSTeamsAdaptiveCardActivity(card) {
960
951
  }]
961
952
  };
962
953
  }
963
- //#endregion
964
- //#region extensions/msteams/src/revoked-context.ts
954
+ // extensions/msteams/src/revoked-context.ts
965
955
  async function withRevokedProxyFallback(params) {
966
956
  try {
967
957
  return await params.run();
@@ -971,8 +961,7 @@ async function withRevokedProxyFallback(params) {
971
961
  return await params.onRevoked();
972
962
  }
973
963
  }
974
- //#endregion
975
- //#region extensions/msteams/src/sent-message-cache.ts
964
+ // extensions/msteams/src/sent-message-cache.ts
976
965
  const TTL_MS = 864e5;
977
966
  const MAX_ENTRIES = 2e4;
978
967
  const PERSISTENT_MAX_ENTRIES = 1e3;
@@ -1021,8 +1010,7 @@ async function wasMSTeamsMessageSentWithPersistence(params) {
1021
1010
  if (!params.conversationId || !params.messageId) return false;
1022
1011
  return await getSentMessageCache((0, openclaw_plugin_sdk_account_id.normalizeAccountId)(params.accountId)).lookup(makeKey(params.conversationId, params.messageId, params.botId));
1023
1012
  }
1024
- //#endregion
1025
- //#region extensions/msteams/src/sdk-proactive.ts
1013
+ // extensions/msteams/src/sdk-proactive.ts
1026
1014
  const loadMSTeamsApiModule = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeModule)(() => import("@microsoft/teams.api"));
1027
1015
  async function quoteMSTeamsActivity(activity, messageId) {
1028
1016
  const { MessageActivityInput } = await loadMSTeamsApiModule();
@@ -1158,8 +1146,7 @@ async function deleteMSTeamsActivityWithReference(app, source, activityId, optio
1158
1146
  const ref = buildSdkConversationReference(source, options);
1159
1147
  return (await getApiClientForReference(app, ref)).conversations.activities(ref.conversation.id).delete(activityId);
1160
1148
  }
1161
- //#endregion
1162
- //#region extensions/msteams/src/messenger.ts
1149
+ // extensions/msteams/src/messenger.ts
1163
1150
  const MSTEAMS_SEND_ATTEMPTS = 3;
1164
1151
  const MSTEAMS_SEND_RETRY_MAX_DELAY_MS = 1e4;
1165
1152
  function buildConversationReference(ref) {
@@ -1372,8 +1359,7 @@ async function sendMSTeamsMessages(params) {
1372
1359
  }
1373
1360
  return await sendProactively(messages, 0);
1374
1361
  }
1375
- //#endregion
1376
- //#region extensions/msteams/src/polls.ts
1362
+ // extensions/msteams/src/polls.ts
1377
1363
  const MSTEAMS_POLLS_NAMESPACE = "polls";
1378
1364
  const MSTEAMS_POLL_VOTE_BUCKETS_NAMESPACE = "poll-vote-buckets";
1379
1365
  const MSTEAMS_MAX_POLLS = 1e3;
@@ -1647,8 +1633,7 @@ function createMSTeamsPollStoreState(params) {
1647
1633
  recordVote
1648
1634
  };
1649
1635
  }
1650
- //#endregion
1651
- //#region extensions/msteams/src/conversation-store-helpers.ts
1636
+ // extensions/msteams/src/conversation-store-helpers.ts
1652
1637
  function mergeStoredConversationReference(existing, incoming, nowIso) {
1653
1638
  return {
1654
1639
  ...existing?.timezone && !incoming.timezone ? { timezone: existing.timezone } : {},
@@ -1678,8 +1663,7 @@ function findPreferredDmConversationByUserId(entries, id) {
1678
1663
  }
1679
1664
  return preferred;
1680
1665
  }
1681
- //#endregion
1682
- //#region extensions/msteams/src/conversation-store-state.ts
1666
+ // extensions/msteams/src/conversation-store-state.ts
1683
1667
  const MSTEAMS_CONVERSATIONS_NAMESPACE = "conversations";
1684
1668
  const MSTEAMS_MAX_CONVERSATIONS = 1e3;
1685
1669
  const MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS = 2e3;
@@ -1770,7 +1754,6 @@ function createMSTeamsConversationStoreState(params) {
1770
1754
  findPreferredDmByUserId
1771
1755
  };
1772
1756
  }
1773
- //#endregion
1774
1757
  Object.defineProperty(exports, "FILE_CONSENT_THRESHOLD_BYTES", {
1775
1758
  enumerable: true,
1776
1759
  get: function() {
@@ -1,12 +1,12 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
2
- const require_runtime = require("./runtime-gZTAuFux.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CiKaZLfC.cjs");
2
+ const require_runtime = require("./runtime-CbKazLGv.cjs");
3
3
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
4
4
  let node_crypto = require("node:crypto");
5
5
  node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
6
6
  let node_path = require("node:path");
7
7
  node_path = require_rolldown_runtime.__toESM(node_path, 1);
8
8
  let openclaw_plugin_sdk_keyed_async_queue = require("openclaw/plugin-sdk/keyed-async-queue");
9
- //#region extensions/msteams/src/sqlite-state.ts
9
+ // extensions/msteams/src/sqlite-state.ts
10
10
  function resolveMSTeamsAccountStateNamespace(namespace, accountId) {
11
11
  const normalizedAccountId = (0, openclaw_plugin_sdk_account_id.normalizeAccountId)(accountId);
12
12
  if (normalizedAccountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID) return namespace;
@@ -21,8 +21,7 @@ async function withMSTeamsSqliteMutationLock(mutationKey, fn) {
21
21
  const scopedMutationKey = node_path.default.join(require_runtime.getMSTeamsRuntime().state.resolveStateDir(), mutationKey);
22
22
  return await sqliteMutationLocks.enqueue(scopedMutationKey, fn);
23
23
  }
24
- //#endregion
25
- //#region extensions/msteams/src/delegated-state.ts
24
+ // extensions/msteams/src/delegated-state.ts
26
25
  const MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME = "msteams-delegated.json";
27
26
  const MSTEAMS_DELEGATED_TOKEN_NAMESPACE = "delegated-token";
28
27
  const MSTEAMS_DELEGATED_TOKEN_KEY = "current";
@@ -53,7 +52,6 @@ async function saveMSTeamsDelegatedTokens(tokens, accountId) {
53
52
  if (!normalized) throw new Error("Invalid Microsoft Teams delegated token payload");
54
53
  await openDelegatedTokenStore(accountId).register(MSTEAMS_DELEGATED_TOKEN_KEY, normalized);
55
54
  }
56
- //#endregion
57
55
  Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_KEY", {
58
56
  enumerable: true,
59
57
  get: function() {
@@ -1,15 +1,15 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
2
- const require_bot_framework_service_url = require("./bot-framework-service-url-B3FWn2SV.cjs");
3
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
4
- const require_runtime = require("./runtime-gZTAuFux.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CiKaZLfC.cjs");
2
+ const require_bot_framework_service_url = require("./bot-framework-service-url-CgVuKiIR.cjs");
3
+ const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
4
+ const require_runtime = require("./runtime-CbKazLGv.cjs");
5
5
  require("../runtime-api.cjs");
6
- const require_delegated_state = require("./delegated-state-Bv5cWuec.cjs");
7
- const require_channel = require("./channel-Du4L0JEh.cjs");
8
- const require_thread_session = require("./thread-session-BWVCoYza.cjs");
9
- const require_channel_setup = require("./channel.setup-BN3uhq3r.cjs");
10
- const require_approval_card = require("./approval-card-DWPDItvq.cjs");
11
- const require_conversation_store_state = require("./conversation-store-state-B-4g4uq5.cjs");
12
- const require_reaction_types = require("./reaction-types-CwP5RVQB.cjs");
6
+ const require_delegated_state = require("./delegated-state-CbMd3rIh.cjs");
7
+ const require_channel = require("./channel-CdCSk3Rg.cjs");
8
+ const require_thread_session = require("./thread-session-DZMoCsSR.cjs");
9
+ const require_channel_setup = require("./channel.setup-nSTtK77J.cjs");
10
+ const require_approval_card = require("./approval-card-Bo8kHYbj.cjs");
11
+ const require_conversation_store_state = require("./conversation-store-state-NJU9osd-.cjs");
12
+ const require_reaction_types = require("./reaction-types-BaL1EVBS.cjs");
13
13
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
14
14
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
15
15
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
@@ -45,7 +45,7 @@ let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runt
45
45
  let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
46
46
  let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
47
47
  let openclaw_plugin_sdk_webhook_ingress = require("openclaw/plugin-sdk/webhook-ingress");
48
- //#region extensions/msteams/src/feedback-reflection-store.ts
48
+ // extensions/msteams/src/feedback-reflection-store.ts
49
49
  const LEARNINGS_NAMESPACE = "feedback-learnings";
50
50
  const MAX_LEARNING_ENTRIES = 1e4;
51
51
  function learningStoreKey(storePath, sessionKey) {
@@ -78,8 +78,7 @@ async function storeSessionLearning(params) {
78
78
  observed = result.current;
79
79
  }
80
80
  }
81
- //#endregion
82
- //#region extensions/msteams/src/feedback-reflection.ts
81
+ // extensions/msteams/src/feedback-reflection.ts
83
82
  /**
84
83
  * Run a background reflection after negative feedback.
85
84
  * This is designed to be called fire-and-forget (don't await in the invoke handler).
@@ -150,8 +149,7 @@ async function runFeedbackReflection(params) {
150
149
  log.debug?.("failed to send reflection follow-up", { error: require_channel_setup.formatUnknownError(err) });
151
150
  }
152
151
  }
153
- //#endregion
154
- //#region extensions/msteams/src/adaptive-card-submit.ts
152
+ // extensions/msteams/src/adaptive-card-submit.ts
155
153
  function extractAdaptiveCardSubmittedData(value) {
156
154
  if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return value;
157
155
  const action = (0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value.action) ? value.action : void 0;
@@ -179,8 +177,7 @@ function serializeMSTeamsAdaptiveCardActionValue(value) {
179
177
  return null;
180
178
  }
181
179
  }
182
- //#endregion
183
- //#region extensions/msteams/src/approval-card-submit.ts
180
+ // extensions/msteams/src/approval-card-submit.ts
184
181
  function isMSTeamsApprovalSubmit(value) {
185
182
  if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return false;
186
183
  if (value.openclawAction === "approval") return true;
@@ -264,8 +261,7 @@ async function maybeHandleMSTeamsApprovalCardSubmit(params) {
264
261
  });
265
262
  return true;
266
263
  }
267
- //#endregion
268
- //#region extensions/msteams/src/monitor-handler/access.ts
264
+ // extensions/msteams/src/monitor-handler/access.ts
269
265
  const msteamsIngressIdentity = {
270
266
  key: "sender-id",
271
267
  authentication: "asserted",
@@ -542,8 +538,7 @@ async function admitMSTeamsMessage(params) {
542
538
  isChannel: params.isChannel
543
539
  };
544
540
  }
545
- //#endregion
546
- //#region src/channels/mention-gating.ts
541
+ // src/channels/mention-gating.ts
547
542
  function resolveBotThreadMentionPolicy(params) {
548
543
  if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
549
544
  requireMention: params.requireMention,
@@ -554,8 +549,7 @@ function resolveBotThreadMentionPolicy(params) {
554
549
  implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
555
550
  };
556
551
  }
557
- //#endregion
558
- //#region extensions/msteams/src/monitor-handler/config.ts
552
+ // extensions/msteams/src/monitor-handler/config.ts
559
553
  function createMSTeamsHandlerConfigReader(deps) {
560
554
  const source = deps.accountPolicyCfg ?? deps.cfg;
561
555
  const read = (0, openclaw_plugin_sdk_runtime_config_snapshot.createRuntimeConfigReader)(source);
@@ -580,8 +574,7 @@ function createMSTeamsHandlerConfigReader(deps) {
580
574
  });
581
575
  };
582
576
  }
583
- //#endregion
584
- //#region extensions/msteams/src/attachments/bot-framework.ts
577
+ // extensions/msteams/src/attachments/bot-framework.ts
585
578
  const BOT_FRAMEWORK_SCOPE = "https://api.botframework.com";
586
579
  /**
587
580
  * Detect Bot Framework personal chat ("a:") and MSA orgid ("8:orgid:") conversation
@@ -746,8 +739,7 @@ async function downloadMSTeamsBotFrameworkAttachments(params) {
746
739
  attachmentCount: unique.length
747
740
  };
748
741
  }
749
- //#endregion
750
- //#region extensions/msteams/src/attachments/html.ts
742
+ // extensions/msteams/src/attachments/html.ts
751
743
  /**
752
744
  * Extract every `<attachment id="...">` reference from the HTML attachments in
753
745
  * the inbound activity. Returns the complete (non-sliced) list; callers that
@@ -837,8 +829,7 @@ function resolveMSTeamsAdvertisedMedia(attachments) {
837
829
  ...htmlAttachmentIds.map((sourceId) => createAdvertisedMediaFact("document", sourceId))
838
830
  ];
839
831
  }
840
- //#endregion
841
- //#region extensions/msteams/src/attachments/remote-media.ts
832
+ // extensions/msteams/src/attachments/remote-media.ts
842
833
  /**
843
834
  * Direct save path used when the caller supplies the already-guarded fetch
844
835
  * implementation. This lets Teams-specific auth fallback own the request
@@ -866,8 +857,7 @@ async function downloadAndStoreMSTeamsRemoteMedia(params) {
866
857
  await response.body?.cancel().catch(() => void 0);
867
858
  }
868
859
  }
869
- //#endregion
870
- //#region extensions/msteams/src/attachments/download.ts
860
+ // extensions/msteams/src/attachments/download.ts
871
861
  function resolveDownloadCandidate(att, graphReferenceToken) {
872
862
  const contentType = require_resolve_allowlist.normalizeContentType(att.contentType);
873
863
  const graphReference = graphReferenceToken !== void 0 && contentType === "reference";
@@ -1098,8 +1088,7 @@ async function downloadMSTeamsAttachments(params) {
1098
1088
  function safeHostForLog(url) {
1099
1089
  return URL.parse(url)?.host ?? "invalid-url";
1100
1090
  }
1101
- //#endregion
1102
- //#region extensions/msteams/src/attachments/graph.ts
1091
+ // extensions/msteams/src/attachments/graph.ts
1103
1092
  function createGraphHostedContentFact(item) {
1104
1093
  const contentType = require_resolve_allowlist.normalizeContentType(item.contentType);
1105
1094
  return {
@@ -1346,8 +1335,7 @@ async function downloadMSTeamsGraphMedia(params) {
1346
1335
  messageUrl
1347
1336
  };
1348
1337
  }
1349
- //#endregion
1350
- //#region extensions/msteams/src/monitor-handler/inbound-media.ts
1338
+ // extensions/msteams/src/monitor-handler/inbound-media.ts
1351
1339
  function shouldAttemptMSTeamsGraphMediaFallback(params) {
1352
1340
  const conversationType = params.conversationType.trim().toLowerCase();
1353
1341
  return params.graphMediaFallback === true && (conversationType === "channel" || conversationType === "groupchat") && (params.htmlSummary?.htmlAttachments ?? 0) > 0;
@@ -1488,8 +1476,7 @@ async function resolveMSTeamsInboundMedia(params) {
1488
1476
  });
1489
1477
  return mediaList;
1490
1478
  }
1491
- //#endregion
1492
- //#region extensions/msteams/src/monitor-handler/inbound-content.ts
1479
+ // extensions/msteams/src/monitor-handler/inbound-content.ts
1493
1480
  async function prepareMSTeamsInboundContent(params) {
1494
1481
  const activity = params.entry.context.activity;
1495
1482
  const mayRecoverGraphMedia = Boolean(params.htmlSummary?.attachmentIds.length) || shouldAttemptMSTeamsGraphMediaFallback({
@@ -1552,8 +1539,7 @@ async function prepareMSTeamsInboundContent(params) {
1552
1539
  inboundMedia
1553
1540
  };
1554
1541
  }
1555
- //#endregion
1556
- //#region extensions/msteams/src/informative-status.ts
1542
+ // extensions/msteams/src/informative-status.ts
1557
1543
  const INFORMATIVE_MAX_CHARS = 1e3;
1558
1544
  const INFORMATIVE_MAX_BYTES = 1024;
1559
1545
  const ELLIPSIS = "…";
@@ -1576,8 +1562,7 @@ function flattenInformativeStatus(text) {
1576
1562
  }
1577
1563
  return ELLIPSIS + graphemes.slice(start).join("");
1578
1564
  }
1579
- //#endregion
1580
- //#region extensions/msteams/src/reply-stream-controller.ts
1565
+ // extensions/msteams/src/reply-stream-controller.ts
1581
1566
  function isStreamCancelledError(err) {
1582
1567
  return err instanceof Error && err.name === "StreamCancelledError";
1583
1568
  }
@@ -1877,8 +1862,7 @@ function createTeamsReplyStreamController(params) {
1877
1862
  wasCanceled
1878
1863
  };
1879
1864
  }
1880
- //#endregion
1881
- //#region extensions/msteams/src/reply-dispatcher.ts
1865
+ // extensions/msteams/src/reply-dispatcher.ts
1882
1866
  function createMSTeamsReplyDispatcher(params) {
1883
1867
  const core = require_runtime.getMSTeamsRuntime();
1884
1868
  const msteamsCfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(params.cfg, params.accountId);
@@ -2193,8 +2177,7 @@ function createMSTeamsReplyDispatcher(params) {
2193
2177
  }
2194
2178
  };
2195
2179
  }
2196
- //#endregion
2197
- //#region extensions/msteams/src/monitor-handler/inbound-dispatch.ts
2180
+ // extensions/msteams/src/monitor-handler/inbound-dispatch.ts
2198
2181
  async function dispatchMSTeamsInboundTurn(params) {
2199
2182
  const core = require_runtime.getMSTeamsRuntime();
2200
2183
  const { cfg, runtime, app, tokenProvider, textLimit, log, logVerboseMessage, facts, admission, content, routing, thread, replyStyle, timestamp, contextVisibilityMode, conversationHistories, historyLimit } = params;
@@ -2431,8 +2414,7 @@ async function dispatchMSTeamsInboundTurn(params) {
2431
2414
  return { kind: "failed" };
2432
2415
  }
2433
2416
  }
2434
- //#endregion
2435
- //#region extensions/msteams/src/monitor-handler/inbound-facts.ts
2417
+ // extensions/msteams/src/monitor-handler/inbound-facts.ts
2436
2418
  function extractTextFromHtmlAttachments(attachments) {
2437
2419
  for (const attachment of attachments) {
2438
2420
  const raw = require_resolve_allowlist.extractHtmlFromAttachment(attachment);
@@ -2534,8 +2516,7 @@ function assembleMSTeamsInboundFacts(entry) {
2534
2516
  })
2535
2517
  };
2536
2518
  }
2537
- //#endregion
2538
- //#region extensions/msteams/src/team-identity.ts
2519
+ // extensions/msteams/src/team-identity.ts
2539
2520
  const teamGroupIdCache = /* @__PURE__ */ new Map();
2540
2521
  const TEAM_GROUP_ID_CACHE_MAX_ENTRIES = 500;
2541
2522
  function cacheTeamGroupId(conversationTeamId, groupId) {
@@ -2562,8 +2543,7 @@ async function resolveTeamGroupId(params) {
2562
2543
  cacheTeamGroupId(params.conversationTeamId, groupId);
2563
2544
  return groupId;
2564
2545
  }
2565
- //#endregion
2566
- //#region extensions/msteams/src/thread-parent-context.ts
2546
+ // extensions/msteams/src/thread-parent-context.ts
2567
2547
  const PARENT_CACHE_TTL_MS = 3e5;
2568
2548
  const PARENT_CACHE_MAX = 100;
2569
2549
  const parentCache = /* @__PURE__ */ new Map();
@@ -2615,8 +2595,7 @@ function shouldInjectParentContext(sessionKey, parentId) {
2615
2595
  function markParentContextInjected(sessionKey, parentId) {
2616
2596
  touchLru(injectedParents, sessionKey, parentId, INJECTED_MAX);
2617
2597
  }
2618
- //#endregion
2619
- //#region extensions/msteams/src/monitor-handler/thread-context.ts
2598
+ // extensions/msteams/src/monitor-handler/thread-context.ts
2620
2599
  function prepareMSTeamsThreadRouting(params) {
2621
2600
  const route = require_runtime.getMSTeamsRuntime().channel.routing.resolveAgentRoute({
2622
2601
  cfg: params.cfg,
@@ -2748,8 +2727,7 @@ async function resolveMSTeamsThreadContext(params) {
2748
2727
  threadContext
2749
2728
  };
2750
2729
  }
2751
- //#endregion
2752
- //#region extensions/msteams/src/monitor-handler/message-handler.ts
2730
+ // extensions/msteams/src/monitor-handler/message-handler.ts
2753
2731
  function createMSTeamsMessageHandler(deps) {
2754
2732
  const { cfg, accountPolicyCfg = cfg, accountId, runtime, appId, app, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
2755
2733
  const core = require_runtime.getMSTeamsRuntime();
@@ -3054,8 +3032,7 @@ function createMSTeamsMessageHandler(deps) {
3054
3032
  if (turnAdoptionLifecycle) return { kind: "deferred" };
3055
3033
  };
3056
3034
  }
3057
- //#endregion
3058
- //#region extensions/msteams/src/monitor-handler/reaction-handler.ts
3035
+ // extensions/msteams/src/monitor-handler/reaction-handler.ts
3059
3036
  function createMSTeamsReactionHandler(deps) {
3060
3037
  const { accountId, log } = deps;
3061
3038
  const readConfig = deps.readConfig ?? createMSTeamsHandlerConfigReader(deps);
@@ -3144,8 +3121,7 @@ function createMSTeamsReactionHandler(deps) {
3144
3121
  }
3145
3122
  };
3146
3123
  }
3147
- //#endregion
3148
- //#region extensions/msteams/src/welcome-card.ts
3124
+ // extensions/msteams/src/welcome-card.ts
3149
3125
  const DEFAULT_PROMPT_STARTERS = [
3150
3126
  "What can you do?",
3151
3127
  "Summarize my last meeting",
@@ -3181,8 +3157,7 @@ function buildGroupWelcomeText(botName) {
3181
3157
  const name = botName || "OpenClaw";
3182
3158
  return `Hi! I'm ${name}. Mention me with @${name} to get started.`;
3183
3159
  }
3184
- //#endregion
3185
- //#region extensions/msteams/src/monitor-handler.ts
3160
+ // extensions/msteams/src/monitor-handler.ts
3186
3161
  async function isMSTeamsInvokeAuthorized(params) {
3187
3162
  const { context, deps, invokeKind } = params;
3188
3163
  const cfg = deps.readConfig?.() ?? deps.cfg;
@@ -3300,8 +3275,7 @@ function createMSTeamsActivityHandler(deps) {
3300
3275
  }
3301
3276
  };
3302
3277
  }
3303
- //#endregion
3304
- //#region extensions/msteams/src/feedback-invoke.ts
3278
+ // extensions/msteams/src/feedback-invoke.ts
3305
3279
  /** Return whether feedback consumed the invoke; the SDK owns its HTTP acknowledgement. */
3306
3280
  async function runMSTeamsFeedbackInvokeHandler(context, deps) {
3307
3281
  const activity = context.activity;
@@ -3412,8 +3386,7 @@ async function runMSTeamsFeedbackInvokeHandler(context, deps) {
3412
3386
  });
3413
3387
  return true;
3414
3388
  }
3415
- //#endregion
3416
- //#region extensions/msteams/src/file-consent-invoke.ts
3389
+ // extensions/msteams/src/file-consent-invoke.ts
3417
3390
  async function handleMSTeamsFileConsentInvoke(context, log) {
3418
3391
  const expiredUploadMessage = "The file upload request has expired. Please try sending the file again.";
3419
3392
  const activity = context.activity;
@@ -3515,16 +3488,14 @@ async function runMSTeamsFileConsentInvokeHandler(context, log) {
3515
3488
  log.debug?.("file consent handler error", { error: require_channel_setup.formatUnknownError(err) });
3516
3489
  }
3517
3490
  }
3518
- //#endregion
3519
- //#region extensions/msteams/src/monitor-account-stores.ts
3491
+ // extensions/msteams/src/monitor-account-stores.ts
3520
3492
  function createMSTeamsMonitorStores(accountId, overrides) {
3521
3493
  return {
3522
3494
  conversationStore: overrides.conversationStore ?? require_conversation_store_state.createMSTeamsConversationStoreState({ accountId }),
3523
3495
  pollStore: overrides.pollStore ?? require_conversation_store_state.createMSTeamsPollStoreState({ accountId })
3524
3496
  };
3525
3497
  }
3526
- //#endregion
3527
- //#region extensions/msteams/src/monitor-status.ts
3498
+ // extensions/msteams/src/monitor-status.ts
3528
3499
  function publishMSTeamsBlocked(statusSink, lastError) {
3529
3500
  statusSink?.((0, openclaw_plugin_sdk_gateway_runtime.channelBlockedPatch)(lastError, { running: true }));
3530
3501
  }
@@ -3534,8 +3505,7 @@ function publishMSTeamsReady(statusSink, now = Date.now()) {
3534
3505
  function publishMSTeamsStopped(statusSink) {
3535
3506
  statusSink?.((0, openclaw_plugin_sdk_gateway_runtime.channelStoppedPatch)());
3536
3507
  }
3537
- //#endregion
3538
- //#region extensions/msteams/src/msteams-ingress.ts
3508
+ // extensions/msteams/src/msteams-ingress.ts
3539
3509
  const MSTEAMS_INGRESS_VERSION = 1;
3540
3510
  const MSTEAMS_INGRESS_DRAIN_INTERVAL_MS = 500;
3541
3511
  const MSTEAMS_INGRESS_MAX_CONCURRENT_DELIVERIES = 8;
@@ -3664,8 +3634,7 @@ function createMSTeamsIngress(options) {
3664
3634
  }
3665
3635
  };
3666
3636
  }
3667
- //#endregion
3668
- //#region extensions/msteams/src/replay-context.ts
3637
+ // extensions/msteams/src/replay-context.ts
3669
3638
  function createMSTeamsReplayContext(activity, app, serviceUrlBoundary, accountId) {
3670
3639
  const rawConversationId = activity.conversation?.id ?? "";
3671
3640
  const conversationId = require_resolve_allowlist.normalizeMSTeamsConversationId(rawConversationId);
@@ -3713,8 +3682,7 @@ function createMSTeamsReplayContext(activity, app, serviceUrlBoundary, accountId
3713
3682
  getTeamDetails: (teamId) => app.api.teams.getById(teamId)
3714
3683
  };
3715
3684
  }
3716
- //#endregion
3717
- //#region extensions/msteams/src/sso-token-store.ts
3685
+ // extensions/msteams/src/sso-token-store.ts
3718
3686
  /**
3719
3687
  * SQLite-backed store for Bot Framework OAuth SSO tokens.
3720
3688
  *
@@ -3748,8 +3716,7 @@ function createMSTeamsSsoTokenStoreFs(params) {
3748
3716
  }
3749
3717
  };
3750
3718
  }
3751
- //#endregion
3752
- //#region extensions/msteams/src/webhook-handler.ts
3719
+ // extensions/msteams/src/webhook-handler.ts
3753
3720
  /** Keep Express response ownership until the channel's route can be released. */
3754
3721
  function createMSTeamsWebhookHandler(expressApp, warn) {
3755
3722
  const responses = /* @__PURE__ */ new Map();
@@ -3795,8 +3762,7 @@ function createMSTeamsWebhookHandler(expressApp, warn) {
3795
3762
  }
3796
3763
  };
3797
3764
  }
3798
- //#endregion
3799
- //#region extensions/msteams/src/monitor.ts
3765
+ // extensions/msteams/src/monitor.ts
3800
3766
  async function monitorMSTeamsProvider(opts) {
3801
3767
  const core = require_runtime.getMSTeamsRuntime();
3802
3768
  const log = core.logging.getChildLogger({ name: "msteams" });
@@ -4254,5 +4220,4 @@ function adaptSdkContext(ctx, app) {
4254
4220
  stream: sdkCtx.stream
4255
4221
  });
4256
4222
  }
4257
- //#endregion
4258
4223
  exports.monitorMSTeamsProvider = monitorMSTeamsProvider;
@@ -1,7 +1,7 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
2
2
  let openclaw_plugin_sdk_provider_auth = require("openclaw/plugin-sdk/provider-auth");
3
3
  let openclaw_plugin_sdk_provider_auth_runtime = require("openclaw/plugin-sdk/provider-auth-runtime");
4
- //#region extensions/msteams/src/oauth.flow.ts
4
+ // extensions/msteams/src/oauth.flow.ts
5
5
  function buildMSTeamsAuthUrl(params) {
6
6
  const scopes = params.scopes ?? require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES;
7
7
  return `${require_resolve_allowlist.buildMSTeamsAuthEndpoint(params.tenantId)}?${new URLSearchParams({
@@ -15,8 +15,7 @@ function buildMSTeamsAuthUrl(params) {
15
15
  prompt: "consent"
16
16
  }).toString()}`;
17
17
  }
18
- //#endregion
19
- //#region extensions/msteams/src/oauth.ts
18
+ // extensions/msteams/src/oauth.ts
20
19
  async function loginMSTeamsDelegated(ctx, params) {
21
20
  await ctx.note([
22
21
  "You are running in a remote/VPS environment.",
@@ -51,5 +50,4 @@ async function loginMSTeamsDelegated(ctx, params) {
51
50
  verifier
52
51
  });
53
52
  }
54
- //#endregion
55
53
  exports.loginMSTeamsDelegated = loginMSTeamsDelegated;
@@ -1,5 +1,5 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
2
- //#region extensions/msteams/src/graph-thread.ts
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
2
+ // extensions/msteams/src/graph-thread.ts
3
3
  /** Keep inbound thread enrichment bounded while still reaching recent replies. */
4
4
  const MAX_REPLY_PAGES = 50;
5
5
  function compareThreadMessagesChronologically(a, b) {
@@ -88,8 +88,7 @@ function buildThreadContext(messages, currentMessageId) {
88
88
  }
89
89
  return context;
90
90
  }
91
- //#endregion
92
- //#region extensions/msteams/src/reaction-types.ts
91
+ // extensions/msteams/src/reaction-types.ts
93
92
  const TEAMS_REACTION_EMOJI = {
94
93
  like: "👍",
95
94
  heart: "❤️",
@@ -108,7 +107,6 @@ function resolveMSTeamsReactionEmoji(raw) {
108
107
  if (!normalized) throw new Error(`Reaction type is required. Common types: ${TEAMS_REACTION_TYPES.join(", ")}`);
109
108
  return getMSTeamsReactionEmoji(normalized) ?? normalized;
110
109
  }
111
- //#endregion
112
110
  Object.defineProperty(exports, "buildThreadContext", {
113
111
  enumerable: true,
114
112
  get: function() {