@openclaw/msteams 2026.10.10-beta.5 → 2026.11.5-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.
Files changed (39) hide show
  1. package/dist/.setup/{adapter.runtime-B-6Q3nMI.cjs → adapter.runtime-UOD_H_ph.cjs} +23 -28
  2. package/dist/.setup/{approval-card-DWPDItvq.cjs → approval-card-CD5q0Nla.cjs} +7 -13
  3. package/dist/.setup/{approval-handler.runtime-CGIr9ItR.cjs → approval-handler.runtime-DbPxvynk.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-DQrXOfhf.cjs} +43 -263
  6. package/dist/.setup/{channel.runtime-3-5Ty0Vy.cjs → channel.runtime-Du4GPMES.cjs} +72 -122
  7. package/dist/.setup/{channel.setup-BN3uhq3r.cjs → channel.setup--7ko_Kxv.cjs} +167 -274
  8. package/dist/.setup/{config-schema-CkKdphSp.cjs → config-schema-BEXDIOC-.cjs} +121 -127
  9. package/dist/.setup/{conversation-store-state-B-4g4uq5.cjs → conversation-store-state-AVgRyNE9.cjs} +427 -631
  10. package/dist/.setup/{delegated-state-Bv5cWuec.cjs → delegated-state-DhIHahf1.cjs} +72 -12
  11. package/dist/.setup/{monitor-DK0bsDpk.cjs → monitor-CXjIKz7o.cjs} +1907 -2343
  12. package/dist/.setup/{oauth-BBUQCwmq.cjs → oauth-BWG6qWCd.cjs} +11 -23
  13. package/dist/.setup/presentation-CaLawc5j.cjs +211 -0
  14. package/dist/.setup/{reaction-types-CwP5RVQB.cjs → reaction-types-DOzN5oTl.cjs} +3 -5
  15. package/dist/.setup/{resolve-allowlist-gI34MnpE.cjs → resolve-allowlist-Drj1jaq0.cjs} +230 -122
  16. package/dist/.setup/{rolldown-runtime-BloeesfJ.cjs → rolldown-runtime-CiKaZLfC.cjs} +1 -2
  17. package/dist/.setup/{runtime-gZTAuFux.cjs → runtime-CbKazLGv.cjs} +1 -2
  18. package/dist/.setup/{secret-contract-api-wAyY5UHv.cjs → secret-contract-api-DFqDvc_a.cjs} +5 -8
  19. package/dist/.setup/{secret-contract-api-YY3v6MP8.cjs → secret-contract-api-YGHrfAT0.cjs} +1 -1
  20. package/dist/.setup/{send-ZvscULyk.cjs → send-BRUztzVJ.cjs} +90 -188
  21. package/dist/.setup/{setup-plugin-api-B-NYBLkF.cjs → setup-plugin-api-BHEfter5.cjs} +1 -1
  22. package/dist/.setup/{thread-session-BWVCoYza.cjs → thread-session-BUUV1zk_.cjs} +6 -10
  23. package/dist/.setup/{token-config-bEpua_Q7.cjs → token-config-7K6UbNCo.cjs} +1 -4
  24. package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -1
  25. package/dist/api.cjs +2 -2
  26. package/dist/channel-config-api.cjs +1 -1
  27. package/dist/channel-plugin-api.cjs +1 -1
  28. package/dist/configured-state.cjs +1 -2
  29. package/dist/directory-contract-api.cjs +1 -2
  30. package/dist/doctor-backup-resources.cjs +2 -3
  31. package/dist/doctor-contract-api.cjs +13 -26
  32. package/dist/index.cjs +1 -2
  33. package/dist/qa-runner-api.cjs +3 -5
  34. package/dist/runtime-api.cjs +1 -1
  35. package/dist/secret-contract-api.cjs +1 -1
  36. package/dist/setup-entry.cjs +3 -4
  37. package/dist/setup-plugin-api.cjs +1 -1
  38. package/openclaw.plugin.json +0 -30
  39. package/package.json +11 -11
@@ -1,9 +1,10 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-CiKaZLfC.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.cjs");
3
3
  require("../runtime-api.cjs");
4
4
  const require_directory_contract_api = require("../directory-contract-api.cjs");
5
- const require_thread_session = require("./thread-session-BWVCoYza.cjs");
6
- const require_channel_setup = require("./channel.setup-BN3uhq3r.cjs");
5
+ const require_presentation = require("./presentation-CaLawc5j.cjs");
6
+ const require_thread_session = require("./thread-session-BUUV1zk_.cjs");
7
+ const require_channel_setup = require("./channel.setup--7ko_Kxv.cjs");
7
8
  let openclaw_plugin_sdk_approval_handler_adapter_runtime = require("openclaw/plugin-sdk/approval-handler-adapter-runtime");
8
9
  let openclaw_plugin_sdk_channel_actions = require("openclaw/plugin-sdk/channel-actions");
9
10
  let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
@@ -23,11 +24,10 @@ let openclaw_plugin_sdk_reply_reference = require("openclaw/plugin-sdk/reply-ref
23
24
  let openclaw_plugin_sdk_approval_delivery_runtime = require("openclaw/plugin-sdk/approval-delivery-runtime");
24
25
  let openclaw_plugin_sdk_approval_native_runtime = require("openclaw/plugin-sdk/approval-native-runtime");
25
26
  let typebox = require("typebox");
26
- let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
27
27
  let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
28
28
  let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
29
29
  let openclaw_plugin_sdk_channel_status = require("openclaw/plugin-sdk/channel-status");
30
- //#region extensions/msteams/src/action-params.ts
30
+ // extensions/msteams/src/action-params.ts
31
31
  /** Text and upload-source aliases shared by Teams message actions. */
32
32
  function resolveActionContent(params) {
33
33
  return typeof params.text === "string" ? params.text : typeof params.content === "string" ? params.content : typeof params.message === "string" ? params.message : "";
@@ -42,8 +42,7 @@ function resolveActionUploadFilePath(params) {
42
42
  if (value.trim()) return value;
43
43
  }
44
44
  }
45
- //#endregion
46
- //#region extensions/msteams/src/action-results.ts
45
+ // extensions/msteams/src/action-results.ts
47
46
  function jsonActionResult(data, details = data) {
48
47
  return (0, openclaw_plugin_sdk_tool_results.textResult)(JSON.stringify(data), details);
49
48
  }
@@ -78,90 +77,7 @@ function actionError(message) {
78
77
  ...(0, openclaw_plugin_sdk_tool_results.textResult)(message, { error: message })
79
78
  };
80
79
  }
81
- //#endregion
82
- //#region extensions/msteams/src/policy.ts
83
- function matchMSTeamsPolicyEntry(entries, ...keys) {
84
- return (0, openclaw_plugin_sdk_channel_targets.resolveChannelEntryMatchWithFallback)({
85
- entries,
86
- keys: (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(...keys),
87
- wildcardKey: "*",
88
- normalizeKey: openclaw_plugin_sdk_channel_targets.normalizeChannelSlug
89
- });
90
- }
91
- function selectMSTeamsPolicyEntry(entries, key) {
92
- const match = matchMSTeamsPolicyEntry(entries, key?.trim());
93
- return match.matchKey ?? match.key ? match.entry : void 0;
94
- }
95
- function resolveMSTeamsRouteConfig(params) {
96
- const teamId = params.teamId?.trim();
97
- const teamName = params.teamName?.trim();
98
- const conversationId = params.conversationId?.trim();
99
- const channelName = params.channelName?.trim();
100
- const teams = params.cfg?.teams ?? {};
101
- const allowlistConfigured = Object.keys(teams).length > 0;
102
- const teamMatch = matchMSTeamsPolicyEntry(teams, teamId, params.allowNameMatching ? teamName : void 0, params.allowNameMatching && teamName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(teamName) : void 0);
103
- const teamConfig = teamMatch.entry;
104
- const channels = teamConfig?.channels ?? {};
105
- const channelAllowlistConfigured = Object.keys(channels).length > 0;
106
- const channelMatch = matchMSTeamsPolicyEntry(channels, conversationId, params.allowNameMatching ? channelName : void 0, params.allowNameMatching && channelName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(channelName) : void 0);
107
- const channelConfig = channelMatch.entry;
108
- return {
109
- teamConfig,
110
- channelConfig,
111
- allowlistConfigured,
112
- allowed: (0, openclaw_plugin_sdk_channel_targets.resolveNestedAllowlistDecision)({
113
- outerConfigured: allowlistConfigured,
114
- outerMatched: Boolean(teamConfig),
115
- innerConfigured: channelAllowlistConfigured,
116
- innerMatched: Boolean(channelConfig)
117
- }),
118
- teamKey: teamMatch.matchKey ?? teamMatch.key,
119
- channelKey: channelMatch.matchKey ?? channelMatch.key,
120
- channelMatchKey: channelMatch.matchKey,
121
- channelMatchSource: channelMatch.matchSource === "direct" || channelMatch.matchSource === "wildcard" ? channelMatch.matchSource : void 0
122
- };
123
- }
124
- function resolveMSTeamsGroupToolPolicy(params) {
125
- const cfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(params.cfg, params.accountId);
126
- if (!cfg) return;
127
- const teams = cfg.teams ?? {};
128
- const team = selectMSTeamsPolicyEntry(teams, params.groupSpace);
129
- const channel = team && selectMSTeamsPolicyEntry(team.channels ?? {}, params.groupId);
130
- const resolve = (selectedTeam, selectedChannel) => (0, openclaw_plugin_sdk_channel_policy.resolveScopeToolsPolicy)({
131
- tree: { scopes: {
132
- team: selectedTeam ?? {},
133
- channel: selectedChannel ?? {}
134
- } },
135
- path: ["team", "channel"],
136
- senderPolicyMode: params.senderPolicyMode,
137
- senderId: params.senderId,
138
- senderName: params.senderName,
139
- senderUsername: params.senderUsername,
140
- senderE164: params.senderE164
141
- });
142
- const resolved = resolve(team, channel);
143
- if (resolved !== void 0 || channel) return resolved;
144
- if (params.groupId?.trim()) for (const candidate of Object.values(teams)) {
145
- const matched = selectMSTeamsPolicyEntry(candidate.channels ?? {}, params.groupId);
146
- if (matched) return resolve(candidate, matched);
147
- }
148
- }
149
- function resolveMSTeamsReplyPolicy(params) {
150
- if (params.isDirectMessage) return {
151
- requireMention: false,
152
- replyStyle: "thread"
153
- };
154
- const requireMention = params.channelConfig?.requireMention ?? params.teamConfig?.requireMention ?? params.globalConfig?.requireMention ?? true;
155
- const explicitReplyStyle = params.channelConfig?.replyStyle ?? params.teamConfig?.replyStyle ?? params.globalConfig?.replyStyle;
156
- const requireMentionInBotThreads = params.channelConfig?.requireMentionInBotThreads ?? params.teamConfig?.requireMentionInBotThreads ?? params.globalConfig?.requireMentionInBotThreads;
157
- return {
158
- requireMention,
159
- replyStyle: explicitReplyStyle ?? (requireMention ? "thread" : "top-level"),
160
- ...requireMentionInBotThreads === void 0 ? {} : { requireMentionInBotThreads }
161
- };
162
- }
163
- //#endregion
164
- //#region extensions/msteams/src/action-threading.ts
80
+ // extensions/msteams/src/action-threading.ts
165
81
  /** Normalize Teams conversation targets for equality (strips `conversation:` and `;messageid=`). */
166
82
  function normalizeMSTeamsThreadingTarget(raw) {
167
83
  const value = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(raw);
@@ -208,13 +124,13 @@ function resolveMSTeamsAutoThreadId(params) {
208
124
  team: void 0,
209
125
  channel: void 0
210
126
  };
211
- const routeConfig = resolveMSTeamsRouteConfig({
127
+ const routeConfig = require_presentation.resolveMSTeamsRouteConfig({
212
128
  cfg: params.cfg,
213
129
  teamId: team,
214
130
  conversationId: channel,
215
131
  allowNameMatching: false
216
132
  });
217
- const { replyStyle } = resolveMSTeamsReplyPolicy({
133
+ const { replyStyle } = require_presentation.resolveMSTeamsReplyPolicy({
218
134
  isDirectMessage: false,
219
135
  globalConfig: params.cfg,
220
136
  teamConfig: routeConfig.teamConfig,
@@ -226,8 +142,7 @@ function resolveMSTeamsAutoThreadId(params) {
226
142
  if ((0, openclaw_plugin_sdk_reply_reference.isSingleUseReplyToMode)(context.replyToMode ?? "off") && context.hasRepliedRef?.value) return;
227
143
  return context.currentThreadTs;
228
144
  }
229
- //#endregion
230
- //#region extensions/msteams/src/approval-native.ts
145
+ // extensions/msteams/src/approval-native.ts
231
146
  function isMSTeamsApprovalTransportEnabled(params) {
232
147
  const account = require_resolve_allowlist.resolveMSTeamsAccount(params);
233
148
  return account.enabled && account.configured && account.tokenStatus === "available";
@@ -302,7 +217,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
302
217
  request
303
218
  }),
304
219
  load: async () => {
305
- const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-CGIr9ItR.cjs"));
220
+ const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-DbPxvynk.cjs"));
306
221
  return msTeamsApprovalNativeRuntime;
307
222
  }
308
223
  });
@@ -348,8 +263,7 @@ const msTeamsApprovalCapability = {
348
263
  }),
349
264
  authorizeActorActionAsync: async (params) => require_thread_session.msTeamsApprovalAuth.authorizeActorAction?.(params)
350
265
  };
351
- //#endregion
352
- //#region extensions/msteams/src/channel-message-tool.ts
266
+ // extensions/msteams/src/channel-message-tool.ts
353
267
  function describeMSTeamsMessageTool({ cfg, accountId }) {
354
268
  const account = require_resolve_allowlist.resolveMSTeamsAccount({
355
269
  cfg,
@@ -383,8 +297,7 @@ function describeMSTeamsMessageTool({ cfg, accountId }) {
383
297
  } : null
384
298
  };
385
299
  }
386
- //#endregion
387
- //#region src/gateway/gateway-http-route-contracts.ts
300
+ // src/gateway/gateway-http-route-contracts.ts
388
301
  const GATEWAY_PROBE_ROUTES = /* @__PURE__ */ new Map([
389
302
  ["/health", "live"],
390
303
  ["/healthz", "live"],
@@ -400,8 +313,7 @@ function classifyGatewayProbePath(pathname) {
400
313
  }
401
314
  return "outside";
402
315
  }
403
- //#endregion
404
- //#region packages/normalization-core/src/string-coerce.ts
316
+ // packages/normalization-core/src/string-coerce.ts
405
317
  /** Trims string input and returns null for non-strings or empty strings. */
406
318
  function normalizeNullableString(value) {
407
319
  if (typeof value !== "string") return null;
@@ -409,24 +321,22 @@ function normalizeNullableString(value) {
409
321
  return trimmed ? trimmed : null;
410
322
  }
411
323
  /** Trims string input and returns undefined for non-strings or empty strings. */
412
- function normalizeOptionalString$3(value) {
324
+ function normalizeOptionalString$2(value) {
413
325
  return normalizeNullableString(value) ?? void 0;
414
326
  }
415
327
  /** Lowercases a normalized optional string. */
416
328
  function normalizeOptionalLowercaseString(value) {
417
- return normalizeOptionalString$3(value)?.toLowerCase();
329
+ return normalizeOptionalString$2(value)?.toLowerCase();
418
330
  }
419
331
  /** Lowercases a normalized string or returns an empty string when absent. */
420
332
  function normalizeLowercaseStringOrEmpty$1(value) {
421
333
  return normalizeOptionalLowercaseString(value) ?? "";
422
334
  }
423
- //#endregion
424
- //#region src/plugins/http-path-prefix.ts
335
+ // src/plugins/http-path-prefix.ts
425
336
  function prefixMatchPath(pathname, prefix) {
426
337
  return pathname === prefix || pathname.startsWith(`${prefix}/`) || pathname.startsWith(`${prefix}%`);
427
338
  }
428
- //#endregion
429
- //#region src/gateway/security-path.ts
339
+ // src/gateway/security-path.ts
430
340
  const MAX_PATH_DECODE_PASSES = 32;
431
341
  function normalizePathSeparators(pathname) {
432
342
  const collapsed = pathname.replace(/\/{2,}/g, "/");
@@ -440,7 +350,6 @@ function buildCanonicalPathCandidates(pathname) {
440
350
  const candidates = /* @__PURE__ */ new Set([normalizePathForSecurity(pathname)]);
441
351
  let decoded = pathname;
442
352
  let malformedEncoding = false;
443
- let decodePasses = 0;
444
353
  for (let pass = 0; pass < MAX_PATH_DECODE_PASSES; pass++) {
445
354
  let nextDecoded;
446
355
  try {
@@ -450,7 +359,6 @@ function buildCanonicalPathCandidates(pathname) {
450
359
  break;
451
360
  }
452
361
  if (nextDecoded === decoded) break;
453
- decodePasses += 1;
454
362
  decoded = nextDecoded;
455
363
  candidates.add(normalizePathForSecurity(decoded));
456
364
  }
@@ -462,25 +370,22 @@ function buildCanonicalPathCandidates(pathname) {
462
370
  }
463
371
  return {
464
372
  candidates: [...candidates],
465
- decodePasses,
466
373
  decodePassLimitReached,
467
374
  malformedEncoding
468
375
  };
469
376
  }
470
377
  function canonicalizePathForSecurity(pathname) {
471
- const { candidates, decodePasses, decodePassLimitReached, malformedEncoding } = buildCanonicalPathCandidates(pathname);
378
+ const { candidates, decodePassLimitReached, malformedEncoding } = buildCanonicalPathCandidates(pathname);
472
379
  return {
473
380
  canonicalPath: candidates[candidates.length - 1] ?? "/",
474
381
  candidates,
475
- decodePasses,
476
382
  decodePassLimitReached,
477
383
  malformedEncoding,
478
384
  rawNormalizedPath: normalizePathSeparators(normalizeLowercaseStringOrEmpty$1(pathname)) || "/"
479
385
  };
480
386
  }
481
387
  const PROTECTED_PLUGIN_ROUTE_PREFIXES = ["/api/channels"];
482
- //#endregion
483
- //#region src/gateway/server/plugins-http/path-context.ts
388
+ // src/gateway/server/plugins-http/path-context.ts
484
389
  function normalizeProtectedPrefix(prefix) {
485
390
  const collapsed = normalizeLowercaseStringOrEmpty$1(prefix).replace(/\/{2,}/g, "/");
486
391
  if (collapsed.length <= 1) return collapsed || "/";
@@ -506,16 +411,14 @@ function resolvePluginRoutePathContext(pathname) {
506
411
  rawNormalizedPath: canonical.rawNormalizedPath
507
412
  };
508
413
  }
509
- //#endregion
510
- //#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/gateway-config-runtime
414
+ // \0openclaw:bundled-sdk:openclaw/plugin-sdk/gateway-config-runtime
511
415
  var gateway_config_runtime_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
512
416
  classifyGatewayProbePath: () => classifyGatewayProbePath,
513
417
  isProtectedPluginRoutePathFromContext: () => isProtectedPluginRoutePathFromContext,
514
418
  resolvePluginRoutePathContext: () => resolvePluginRoutePathContext
515
419
  });
516
420
  require_rolldown_runtime.__reExport(gateway_config_runtime_exports, require("openclaw/plugin-sdk/gateway-config-runtime"));
517
- //#endregion
518
- //#region extensions/msteams/src/webhook-route.ts
421
+ // extensions/msteams/src/webhook-route.ts
519
422
  function resolveMSTeamsWebhookCollisionIssue(cfg) {
520
423
  const owners = /* @__PURE__ */ new Map();
521
424
  for (const accountId of require_resolve_allowlist.listMSTeamsAccountIds(cfg)) {
@@ -550,8 +453,7 @@ function resolveMSTeamsWebhookPathIssue({ cfg, env, accountId = openclaw_plugin_
550
453
  const recoveryPath = accountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID ? "/api/messages" : `/api/messages/${accountId}`;
551
454
  return `Microsoft Teams webhook path ${path} ${reason}. Set ${configPath}.webhook.path to ${recoveryPath} and update the Azure Bot messaging endpoint or reverse-proxy upstream to Gateway port ${(0, gateway_config_runtime_exports.resolveGatewayPort)(cfg, env)}${recoveryPath}.` + (legacy ? ` Compatibility port ${legacy.port} continues serving the current path; verify delivery before removing ${resolveMSTeamsLegacyWebhookConfigPath(cfg, accountId)}.` : " The compatibility listener is disabled, so this path cannot receive Teams callbacks.");
552
455
  }
553
- //#endregion
554
- //#region extensions/msteams/src/doctor.ts
456
+ // extensions/msteams/src/doctor.ts
555
457
  const isMSTeamsMutableAllowEntry = (0, openclaw_plugin_sdk_channel_policy.buildMutableAllowEntryDetector)({
556
458
  prefixes: ["msteams:", "user:"],
557
459
  stableIdPattern: /^[^\s@]+$/
@@ -603,8 +505,7 @@ const msteamsDoctor = {
603
505
  collectMutableAllowlistWarnings: collectMSTeamsMutableAllowlistWarnings,
604
506
  runConfigSequence: runMSTeamsWebhookDoctorSequence
605
507
  };
606
- //#endregion
607
- //#region extensions/msteams/src/graph-action-context.ts
508
+ // extensions/msteams/src/graph-action-context.ts
608
509
  const MSTEAMS_GROUP_MANAGEMENT_ACTIONS = /* @__PURE__ */ new Set([
609
510
  "addParticipant",
610
511
  "removeParticipant",
@@ -616,103 +517,7 @@ function withMSTeamsGraphMutationCurrentness(handleAction) {
616
517
  return handleAction(ctx);
617
518
  };
618
519
  }
619
- //#endregion
620
- //#region extensions/msteams/src/presentation.ts
621
- const MSTEAMS_PRESENTATION_CAPABILITIES = {
622
- supported: true,
623
- buttons: true,
624
- selects: false,
625
- context: true,
626
- divider: true,
627
- limits: {
628
- actions: {
629
- supportsStyles: false,
630
- supportsDisabled: false
631
- },
632
- text: { markdownDialect: "markdown" }
633
- }
634
- };
635
- function buildMSTeamsPresentationCard(params) {
636
- const body = [];
637
- const text = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.text);
638
- if (text) body.push({
639
- type: "TextBlock",
640
- text,
641
- wrap: true
642
- });
643
- const presentation = (0, openclaw_plugin_sdk_interactive_runtime.adaptMessagePresentationForChannel)({
644
- presentation: params.presentation,
645
- capabilities: MSTEAMS_PRESENTATION_CAPABILITIES
646
- });
647
- if (presentation.title) body.push({
648
- type: "TextBlock",
649
- text: presentation.title,
650
- weight: "Bolder",
651
- size: "Medium",
652
- wrap: true
653
- });
654
- const actions = [];
655
- for (const block of presentation.blocks) {
656
- if (block.type === "text" || block.type === "context") {
657
- body.push({
658
- type: "TextBlock",
659
- text: block.text,
660
- wrap: true,
661
- ...block.type === "context" ? {
662
- isSubtle: true,
663
- size: "Small"
664
- } : {}
665
- });
666
- continue;
667
- }
668
- if (block.type === "divider") {
669
- body.push({
670
- type: "TextBlock",
671
- text: "---",
672
- wrap: true,
673
- isSubtle: true
674
- });
675
- continue;
676
- }
677
- if (block.type === "buttons") for (const button of block.buttons) {
678
- const action = (0, openclaw_plugin_sdk_interactive_runtime.resolveMessagePresentationButtonAction)(button);
679
- if (action?.type === "url" || action?.type === "web-app") {
680
- const url = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(action.url);
681
- if (!url) continue;
682
- actions.push({
683
- type: "Action.OpenUrl",
684
- title: button.label,
685
- url
686
- });
687
- continue;
688
- }
689
- if (action?.type === "command") {
690
- actions.push({
691
- type: "Action.Submit",
692
- title: button.label,
693
- data: action.command
694
- });
695
- continue;
696
- }
697
- if (action?.type === "callback") actions.push({
698
- type: "Action.Submit",
699
- title: button.label,
700
- data: {
701
- value: action.value,
702
- label: button.label
703
- }
704
- });
705
- }
706
- }
707
- return {
708
- type: "AdaptiveCard",
709
- version: "1.4",
710
- body,
711
- ...actions.length ? { actions } : {}
712
- };
713
- }
714
- //#endregion
715
- //#region extensions/msteams/src/outbound-config.ts
520
+ // extensions/msteams/src/outbound-config.ts
716
521
  const MSTEAMS_TEXT_CHUNK_LIMIT = 4e3;
717
522
  function resolveMSTeamsEffectiveTextChunkLimit(configuredLimit) {
718
523
  return typeof configuredLimit === "number" && configuredLimit > 0 ? Math.min(configuredLimit, MSTEAMS_TEXT_CHUNK_LIMIT) : MSTEAMS_TEXT_CHUNK_LIMIT;
@@ -730,10 +535,9 @@ const msteamsOutboundConfig = {
730
535
  payload: true,
731
536
  messageSendingHooks: true
732
537
  } },
733
- presentationCapabilities: MSTEAMS_PRESENTATION_CAPABILITIES
538
+ presentationCapabilities: require_presentation.MSTEAMS_PRESENTATION_CAPABILITIES
734
539
  };
735
- //#endregion
736
- //#region extensions/msteams/src/read-policy.ts
540
+ // extensions/msteams/src/read-policy.ts
737
541
  function normalizeTarget(raw) {
738
542
  return raw ? require_resolve_allowlist.normalizeMSTeamsMessagingTarget(raw) ?? "" : "";
739
543
  }
@@ -765,9 +569,6 @@ function isCurrentMSTeamsReadTarget(params) {
765
569
  function normalizeUserTarget(target) {
766
570
  return target.replace(/^user:/i, "").trim().toLowerCase();
767
571
  }
768
- function isStableUserId(value) {
769
- return /^[0-9a-f-]{16,}$/i.test(value);
770
- }
771
572
  async function resolveDmTarget(cfg, accountId, target, directOperator = false) {
772
573
  const teams = cfg.channels?.msteams;
773
574
  if (teams?.dmPolicy === "disabled") return;
@@ -775,7 +576,7 @@ async function resolveDmTarget(cfg, accountId, target, directOperator = false) {
775
576
  if (!userId) return;
776
577
  const normalizedEntries = (directOperator ? [] : teams?.allowFrom ?? []).map((entry) => normalizeUserTarget(entry.replace(/^(msteams|teams):/i, "")));
777
578
  const allowAll = directOperator || (teams?.dmPolicy ?? "pairing") === "open" || normalizedEntries.includes("*");
778
- if (isStableUserId(userId)) return allowAll || normalizedEntries.some((entry) => entry === userId) ? `user:${userId}` : void 0;
579
+ if (/^[0-9a-f-]{16,}$/i.test(userId)) return allowAll || normalizedEntries.some((entry) => entry === userId) ? `user:${userId}` : void 0;
779
580
  if (!(0, openclaw_plugin_sdk_dangerous_name_runtime.isDangerousNameMatchingEnabled)(teams)) return;
780
581
  try {
781
582
  const [resolvedTarget, ...resolvedEntries] = await require_resolve_allowlist.resolveMSTeamsUserAllowlist({
@@ -842,7 +643,7 @@ async function resolveAllowedChannelTarget(cfg, accountId, target) {
842
643
  if (groupPolicy === "disabled") return;
843
644
  const [teamId, channelId] = target.split("/", 2);
844
645
  if (!teamId || !channelId) return;
845
- const directRoute = resolveMSTeamsRouteConfig({
646
+ const directRoute = require_presentation.resolveMSTeamsRouteConfig({
846
647
  cfg: teams,
847
648
  teamId,
848
649
  teamName: teamId,
@@ -863,7 +664,7 @@ async function isMappedChannelAllowed(cfg, accountId, teamId, conversationId) {
863
664
  if (!teams?.teams) return false;
864
665
  try {
865
666
  const botFrameworkTeamKey = await resolveConfiguredBotFrameworkTeamKey(cfg, accountId, teamId);
866
- if (botFrameworkTeamKey && resolveMSTeamsRouteConfig({
667
+ if (botFrameworkTeamKey && require_presentation.resolveMSTeamsRouteConfig({
867
668
  cfg: teams,
868
669
  teamId: botFrameworkTeamKey,
869
670
  conversationId
@@ -875,7 +676,7 @@ async function isMappedChannelAllowed(cfg, accountId, teamId, conversationId) {
875
676
  teamIdMode: "graph",
876
677
  teams: teams.teams
877
678
  });
878
- return resolveMSTeamsRouteConfig({
679
+ return require_presentation.resolveMSTeamsRouteConfig({
879
680
  cfg: {
880
681
  ...teams,
881
682
  teams: resolved.teams
@@ -919,7 +720,7 @@ async function assertMSTeamsTeamEnumerationAllowed(params) {
919
720
  const teams = cfg.channels?.msteams;
920
721
  const groupPolicy = resolveMSTeamsReadGroupPolicy(cfg);
921
722
  if (groupPolicy === "disabled") throw new openclaw_plugin_sdk_channel_actions.ToolAuthorizationError("Microsoft Teams channel list is not allowed.");
922
- const directRoute = resolveMSTeamsRouteConfig({
723
+ const directRoute = require_presentation.resolveMSTeamsRouteConfig({
923
724
  cfg: teams,
924
725
  teamId: params.teamId,
925
726
  teamName: params.teamId,
@@ -936,8 +737,7 @@ async function assertMSTeamsTeamEnumerationAllowed(params) {
936
737
  if (!((directRoute.allowlistConfigured ? directRoute.allowed : groupPolicy === "open") || await isMappedChannelAllowed(cfg, accountId, stableTeamId, "__openclaw_all_channels__"))) throw new openclaw_plugin_sdk_channel_actions.ToolAuthorizationError("Microsoft Teams channel list requires access to every channel in the team.");
937
738
  return stableTeamId;
938
739
  }
939
- //#endregion
940
- //#region extensions/msteams/src/session-route.ts
740
+ // extensions/msteams/src/session-route.ts
941
741
  function inferMSTeamsTargetChatType(raw) {
942
742
  const target = (0, openclaw_plugin_sdk_channel_core.stripChannelTargetPrefix)(raw, "msteams", "teams");
943
743
  if (!target) return;
@@ -988,8 +788,7 @@ function resolveMSTeamsOutboundSessionRoute(params) {
988
788
  ...channelThreadId !== void 0 ? { threadId: channelThreadId } : {}
989
789
  } : route;
990
790
  }
991
- //#endregion
992
- //#region extensions/msteams/src/channel.ts
791
+ // extensions/msteams/src/channel.ts
993
792
  const TEAMS_GRAPH_PERMISSION_HINTS = {
994
793
  "ChannelMessage.Read.All": "channel history",
995
794
  "Chat.Read.All": "chat history",
@@ -1005,7 +804,7 @@ const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.create
1005
804
  severity: "warn",
1006
805
  title: "MS Teams security warning"
1007
806
  });
1008
- const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-3-5Ty0Vy.cjs")), "msTeamsChannelRuntime");
807
+ const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-Du4GPMES.cjs")), "msTeamsChannelRuntime");
1009
808
  const MSTEAMS_REACTION_TYPES = [
1010
809
  "like",
1011
810
  "heart",
@@ -1034,12 +833,12 @@ function resolveGraphActionTarget(params, currentChannelId, currentGraphChannelI
1034
833
  }
1035
834
  function resolveMSTeamsActionMessage(ctx, to, allowCurrentMessageIdFallback = false) {
1036
835
  const canUseCurrentMessageId = allowCurrentMessageIdFallback && msteamsContextTargetsMatch(to, {
1037
- currentChannelId: ctx.toolContext?.currentChannelId ?? void 0,
836
+ currentChannelId: ctx.toolContext?.currentChannelId,
1038
837
  currentMessagingTarget: (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.toolContext?.currentGraphChannelId) ?? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.toolContext?.currentMessagingTarget)
1039
838
  });
1040
839
  const resolved = canUseCurrentMessageId ? (0, openclaw_plugin_sdk_channel_actions.resolveReactionMessageId)({
1041
840
  args: ctx.params,
1042
- toolContext: { currentMessageId: ctx.toolContext?.currentMessageId ?? void 0 }
841
+ toolContext: { currentMessageId: ctx.toolContext?.currentMessageId }
1043
842
  }) : (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.params.messageId) ?? "";
1044
843
  const messageId = resolved == null ? "" : String(resolved).trim();
1045
844
  const currentMessageId = ctx.toolContext?.currentMessageId;
@@ -1091,7 +890,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1091
890
  idleMs: 1e3
1092
891
  } },
1093
892
  agentPrompt: { messageToolHints: () => ["- Adaptive Cards supported. Use `action=send` with `card={type,version,body}` to send rich cards.", "- MSTeams targeting: omit `target` to reply to the current conversation (auto-inferred). Explicit targets: `user:ID` or `user:Display Name` (requires Graph API) for DMs, `conversation:19:...@thread.tacv2` for groups/channels. Prefer IDs over display names for speed."] },
1094
- groups: { resolveToolPolicy: resolveMSTeamsGroupToolPolicy },
893
+ groups: { resolveToolPolicy: require_presentation.resolveMSTeamsGroupToolPolicy },
1095
894
  approvalCapability: msTeamsApprovalCapability,
1096
895
  doctor: msteamsDoctor,
1097
896
  messaging: {
@@ -1235,7 +1034,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1235
1034
  });
1236
1035
  const presentation = ctx.action === "send" ? (0, openclaw_plugin_sdk_interactive_runtime.normalizeMessagePresentation)(ctx.params.presentation) : void 0;
1237
1036
  if (ctx.action === "send" && presentation) {
1238
- const card = buildMSTeamsPresentationCard({
1037
+ const card = require_presentation.buildMSTeamsPresentationCard({
1239
1038
  presentation,
1240
1039
  text: resolveActionContent(ctx.params)
1241
1040
  });
@@ -1489,8 +1288,8 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1489
1288
  if (appId) lines.push({ text: `App: ${appId}` });
1490
1289
  const graph = probe?.graph;
1491
1290
  if (graph) {
1492
- const roles = Array.isArray(graph.roles) ? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(graph.roles) : [];
1493
- const scopes = Array.isArray(graph.scopes) ? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(graph.scopes) : [];
1291
+ const roles = graph.roles ?? [];
1292
+ const scopes = graph.scopes ?? [];
1494
1293
  const formatPermission = (permission) => {
1495
1294
  const hint = TEAMS_GRAPH_PERMISSION_HINTS[permission];
1496
1295
  return hint ? `${permission} (${hint})` : permission;
@@ -1514,7 +1313,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1514
1313
  })
1515
1314
  }),
1516
1315
  gateway: { startAccount: async (ctx) => {
1517
- const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./monitor-DK0bsDpk.cjs"));
1316
+ const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./monitor-CXjIKz7o.cjs"));
1518
1317
  const account = require_resolve_allowlist.resolveMSTeamsAccount({
1519
1318
  cfg: ctx.cfg,
1520
1319
  accountId: ctx.accountId
@@ -1590,13 +1389,6 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1590
1389
  },
1591
1390
  outbound: msteamsChannelOutbound
1592
1391
  });
1593
- //#endregion
1594
- Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
1595
- enumerable: true,
1596
- get: function() {
1597
- return buildMSTeamsPresentationCard;
1598
- }
1599
- });
1600
1392
  Object.defineProperty(exports, "inferMSTeamsTargetChatType", {
1601
1393
  enumerable: true,
1602
1394
  get: function() {
@@ -1633,18 +1425,6 @@ Object.defineProperty(exports, "resolveMSTeamsLegacyWebhook", {
1633
1425
  return resolveMSTeamsLegacyWebhook;
1634
1426
  }
1635
1427
  });
1636
- Object.defineProperty(exports, "resolveMSTeamsReplyPolicy", {
1637
- enumerable: true,
1638
- get: function() {
1639
- return resolveMSTeamsReplyPolicy;
1640
- }
1641
- });
1642
- Object.defineProperty(exports, "resolveMSTeamsRouteConfig", {
1643
- enumerable: true,
1644
- get: function() {
1645
- return resolveMSTeamsRouteConfig;
1646
- }
1647
- });
1648
1428
  Object.defineProperty(exports, "resolveMSTeamsWebhookCollisionIssue", {
1649
1429
  enumerable: true,
1650
1430
  get: function() {