@openclaw/msteams 2026.11.3 → 2026.11.5-beta.2

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 (32) hide show
  1. package/dist/.setup/{adapter.runtime-B-6Q3nMI.cjs → adapter.runtime-BB38Rdj_.cjs} +20 -23
  2. package/dist/.setup/{approval-card-DWPDItvq.cjs → approval-card-BHAKsdAM.cjs} +5 -9
  3. package/dist/.setup/{approval-handler.runtime-D0jbDypb.cjs → approval-handler.runtime-C16UvawQ.cjs} +4 -4
  4. package/dist/.setup/{channel-Ci6K9Njb.cjs → channel-BaTw0JW3.cjs} +35 -254
  5. package/dist/.setup/{channel.runtime-DeHVAVxL.cjs → channel.runtime-Ch2M_-jN.cjs} +65 -107
  6. package/dist/.setup/{channel.setup-BN3uhq3r.cjs → channel.setup-B9yKGEse.cjs} +161 -262
  7. package/dist/.setup/{config-schema-CkKdphSp.cjs → config-schema-3lVZ45cB.cjs} +120 -125
  8. package/dist/.setup/{conversation-store-state-B-4g4uq5.cjs → conversation-store-state-CVhMM0QY.cjs} +411 -601
  9. package/dist/.setup/{delegated-state-Bv5cWuec.cjs → delegated-state-ilYzKwD8.cjs} +68 -6
  10. package/dist/.setup/{monitor-cuifGELM.cjs → monitor-b0zPpnmW.cjs} +1883 -2310
  11. package/dist/.setup/{oauth-BBUQCwmq.cjs → oauth-CUtfkgKE.cjs} +10 -21
  12. package/dist/.setup/presentation-Duoi9Ijn.cjs +213 -0
  13. package/dist/.setup/{reaction-types-CwP5RVQB.cjs → reaction-types-C6F6g2nk.cjs} +1 -1
  14. package/dist/.setup/{resolve-allowlist-gI34MnpE.cjs → resolve-allowlist-7mIEepXB.cjs} +214 -90
  15. package/dist/.setup/{secret-contract-api-wAyY5UHv.cjs → secret-contract-api-D554HIrH.cjs} +4 -6
  16. package/dist/.setup/{secret-contract-api-YY3v6MP8.cjs → secret-contract-api-r3hRtbBW.cjs} +1 -1
  17. package/dist/.setup/{send-C9JY42T6.cjs → send-D1w7a_ip.cjs} +86 -182
  18. package/dist/.setup/{setup-plugin-api-B-NYBLkF.cjs → setup-plugin-api-ChovZJU6.cjs} +1 -1
  19. package/dist/.setup/{thread-session-BWVCoYza.cjs → thread-session-CeWYiol_.cjs} +4 -6
  20. package/dist/.setup/{token-config-bEpua_Q7.cjs → token-config-DICiuJWr.cjs} +0 -2
  21. package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -0
  22. package/dist/api.cjs +2 -2
  23. package/dist/channel-config-api.cjs +1 -1
  24. package/dist/channel-plugin-api.cjs +1 -1
  25. package/dist/directory-contract-api.cjs +1 -1
  26. package/dist/doctor-contract-api.cjs +3 -11
  27. package/dist/qa-runner-api.cjs +1 -1
  28. package/dist/secret-contract-api.cjs +1 -1
  29. package/dist/setup-entry.cjs +2 -2
  30. package/dist/setup-plugin-api.cjs +1 -1
  31. package/openclaw.plugin.json +0 -30
  32. package/package.json +11 -11
@@ -10,18 +10,14 @@ node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises, 1);
10
10
  let node_timers_promises = require("node:timers/promises");
11
11
  let node_events = require("node:events");
12
12
  let node_http = require("node:http");
13
+ let node_stream_consumers = require("node:stream/consumers");
14
+ let openclaw_plugin_sdk_http_response_runtime = require("openclaw/plugin-sdk/http-response-runtime");
13
15
  //#region extensions/msteams/src/qa/bot-framework-server.ts
14
16
  const AMBIGUOUS_GATEWAY_TIMEOUT_MARKER = "QA-MSTEAMS-AMBIGUOUS-504";
15
17
  async function readJson(request) {
16
- const chunks = [];
17
- for await (const chunk of request) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
18
- const body = Buffer.concat(chunks).toString("utf8");
18
+ const body = (await (0, node_stream_consumers.buffer)(request)).toString("utf8");
19
19
  return body ? JSON.parse(body) : {};
20
20
  }
21
- function sendJson(response, status, body) {
22
- response.writeHead(status, { "content-type": "application/json" });
23
- response.end(JSON.stringify(body));
24
- }
25
21
  function parseConversationPath(pathname) {
26
22
  const match = /\/v3\/conversations\/([^/]+)\/activities(?:\/[^/]+)?$/u.exec(pathname);
27
23
  if (!match) return;
@@ -38,12 +34,12 @@ async function startMSTeamsQaBotFrameworkServer(options) {
38
34
  const server = (0, node_http.createServer)((request, response) => {
39
35
  (async () => {
40
36
  if (request.headers["x-openclaw-msteams-qa-nonce"] !== options.nonce || request.headers.authorization !== `Bearer ${options.botToken}`) {
41
- sendJson(response, 401, { error: "unauthorized" });
37
+ (0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 401, { error: "unauthorized" });
42
38
  return;
43
39
  }
44
40
  const route = parseConversationPath(new URL(request.url ?? "/", "http://127.0.0.1").pathname);
45
41
  if (request.method !== "POST" || !route) {
46
- sendJson(response, 404, { error: "not found" });
42
+ (0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 404, { error: "not found" });
47
43
  return;
48
44
  }
49
45
  const activity = await readJson(request);
@@ -55,9 +51,9 @@ async function startMSTeamsQaBotFrameworkServer(options) {
55
51
  ...route.threadId ? { threadId: route.threadId } : {}
56
52
  });
57
53
  const acceptedButTimedOut = activity.type === "message" && typeof activity.text === "string" && activity.text.includes(AMBIGUOUS_GATEWAY_TIMEOUT_MARKER);
58
- sendJson(response, acceptedButTimedOut ? 504 : 200, acceptedButTimedOut ? { error: "gateway timeout after acceptance" } : { id: activityId });
54
+ (0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, acceptedButTimedOut ? 504 : 200, acceptedButTimedOut ? { error: "gateway timeout after acceptance" } : { id: activityId });
59
55
  })().catch((error) => {
60
- sendJson(response, 500, { error: (0, openclaw_plugin_sdk_error_runtime.coerceErrorMessage)(error) });
56
+ (0, openclaw_plugin_sdk_http_response_runtime.writeJsonWithoutCharset)(response, 500, { error: (0, openclaw_plugin_sdk_error_runtime.coerceErrorMessage)(error) });
61
57
  });
62
58
  });
63
59
  server.listen(0, "127.0.0.1");
@@ -140,15 +136,15 @@ async function createMSTeamsQaTransportAdapter(context) {
140
136
  const bootstrapPath = node_path.default.join(context.outputDir, ".msteams-private-qa-bootstrap.mjs");
141
137
  const busByNativeMessageId = /* @__PURE__ */ new Map();
142
138
  const nativeByBusMessageId = /* @__PURE__ */ new Map();
143
- const conversationKindByNativeId = /* @__PURE__ */ new Map();
144
- const logicalConversationByNativeId = /* @__PURE__ */ new Map();
139
+ const conversations = /* @__PURE__ */ new Map();
145
140
  const requireGroupMention = context.adapterOptions?.transportPolicy?.requireGroupMention === true;
146
141
  const connector = await startMSTeamsQaBotFrameworkServer({
147
142
  botToken,
148
143
  nonce,
149
144
  async onOutbound(outbound) {
150
- const kind = conversationKindByNativeId.get(outbound.conversationId) ?? "channel";
151
- const conversationId = logicalConversationByNativeId.get(outbound.conversationId) ?? outbound.conversationId;
145
+ const conversation = conversations.get(outbound.conversationId);
146
+ const kind = conversation?.kind ?? "channel";
147
+ const conversationId = conversation?.id ?? outbound.conversationId;
152
148
  const message = await context.messages.addOutboundMessage({
153
149
  accountId,
154
150
  to: `${kind === "direct" ? "dm" : kind}:${conversationId}`,
@@ -159,7 +155,6 @@ async function createMSTeamsQaTransportAdapter(context) {
159
155
  });
160
156
  nativeByBusMessageId.set(message.id, outbound.activityId);
161
157
  busByNativeMessageId.set(outbound.activityId, message.id);
162
- conversationKindByNativeId.set(outbound.conversationId, kind);
163
158
  }
164
159
  });
165
160
  try {
@@ -188,10 +183,13 @@ async function createMSTeamsQaTransportAdapter(context) {
188
183
  requiredPluginIds: ["msteams"],
189
184
  supportedActions: [],
190
185
  async sendInbound(input) {
191
- const conversationId = nativeConversationId(input.conversation.id);
186
+ const { id, kind } = input.conversation;
187
+ const conversationId = nativeConversationId(id);
192
188
  const nativeThreadId = input.threadId ? nativeByBusMessageId.get(input.threadId) ?? input.threadId : void 0;
193
- conversationKindByNativeId.set(conversationId, input.conversation.kind);
194
- logicalConversationByNativeId.set(conversationId, input.conversation.id);
189
+ conversations.set(conversationId, {
190
+ id,
191
+ kind
192
+ });
195
193
  const activityId = `qa-inbound-${(0, node_crypto.randomUUID)()}`;
196
194
  const activity = {
197
195
  id: activityId,
@@ -211,13 +209,13 @@ async function createMSTeamsQaTransportAdapter(context) {
211
209
  },
212
210
  conversation: {
213
211
  id: nativeThreadId ? `${conversationId};messageid=${nativeThreadId}` : conversationId,
214
- conversationType: input.conversation.kind === "direct" ? "personal" : input.conversation.kind === "group" ? "groupChat" : "channel",
212
+ conversationType: kind === "direct" ? "personal" : kind === "group" ? "groupChat" : "channel",
215
213
  tenantId: TENANT_ID
216
214
  },
217
215
  ...input.replyToId ? { replyToId: input.replyToId } : {},
218
216
  channelData: {
219
217
  tenant: { id: TENANT_ID },
220
- ...input.conversation.kind === "channel" ? {
218
+ ...kind === "channel" ? {
221
219
  team: {
222
220
  id: TEAM_ID,
223
221
  aadGroupId: TEAM_AAD_GROUP_ID
@@ -259,8 +257,7 @@ async function createMSTeamsQaTransportAdapter(context) {
259
257
  resetTransport() {
260
258
  busByNativeMessageId.clear();
261
259
  nativeByBusMessageId.clear();
262
- conversationKindByNativeId.clear();
263
- logicalConversationByNativeId.clear();
260
+ conversations.clear();
264
261
  },
265
262
  createGatewayConfig: () => {
266
263
  return { channels: { msteams: {
@@ -124,16 +124,12 @@ function buildMSTeamsPendingApprovalCard(params) {
124
124
  };
125
125
  });
126
126
  const remainingSeconds = Math.max(0, Math.ceil((view.expiresAtMs - nowMs) / 1e3));
127
- const body = [
128
- ...buildCardHeading(`${kindLabel} Approval Required`, `Expires in ${remainingSeconds}s`),
129
- ...buildApprovalSubject(view),
130
- buildApprovalMetadata(view.approvalId, view.metadata)
131
- ];
132
127
  return {
133
- approvalId: view.approvalId,
134
- approvalKind: view.approvalKind,
135
- expiresAtMs: view.expiresAtMs,
136
- card: buildAdaptiveCard(body, actions),
128
+ card: buildAdaptiveCard([
129
+ ...buildCardHeading(`${kindLabel} Approval Required`, `Expires in ${remainingSeconds}s`),
130
+ ...buildApprovalSubject(view),
131
+ buildApprovalMetadata(view.approvalId, view.metadata)
132
+ ], actions),
137
133
  actionTokens,
138
134
  allowedDecisions: view.actions.map(({ decision }) => decision)
139
135
  };
@@ -1,7 +1,7 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
2
- const require_channel = require("./channel-Ci6K9Njb.cjs");
3
- const require_approval_card = require("./approval-card-DWPDItvq.cjs");
4
- const require_send = require("./send-C9JY42T6.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
2
+ const require_channel = require("./channel-BaTw0JW3.cjs");
3
+ const require_approval_card = require("./approval-card-BHAKsdAM.cjs");
4
+ const require_send = require("./send-D1w7a_ip.cjs");
5
5
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
6
6
  let openclaw_plugin_sdk_approval_native_runtime = require("openclaw/plugin-sdk/approval-native-runtime");
7
7
  let openclaw_plugin_sdk_approval_handler_runtime = require("openclaw/plugin-sdk/approval-handler-runtime");
@@ -1,9 +1,10 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.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-Duoi9Ijn.cjs");
6
+ const require_thread_session = require("./thread-session-CeWYiol_.cjs");
7
+ const require_channel_setup = require("./channel.setup-B9yKGEse.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,7 +24,6 @@ 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");
@@ -79,88 +79,6 @@ function actionError(message) {
79
79
  };
80
80
  }
81
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
82
  //#region extensions/msteams/src/action-threading.ts
165
83
  /** Normalize Teams conversation targets for equality (strips `conversation:` and `;messageid=`). */
166
84
  function normalizeMSTeamsThreadingTarget(raw) {
@@ -208,13 +126,13 @@ function resolveMSTeamsAutoThreadId(params) {
208
126
  team: void 0,
209
127
  channel: void 0
210
128
  };
211
- const routeConfig = resolveMSTeamsRouteConfig({
129
+ const routeConfig = require_presentation.resolveMSTeamsRouteConfig({
212
130
  cfg: params.cfg,
213
131
  teamId: team,
214
132
  conversationId: channel,
215
133
  allowNameMatching: false
216
134
  });
217
- const { replyStyle } = resolveMSTeamsReplyPolicy({
135
+ const { replyStyle } = require_presentation.resolveMSTeamsReplyPolicy({
218
136
  isDirectMessage: false,
219
137
  globalConfig: params.cfg,
220
138
  teamConfig: routeConfig.teamConfig,
@@ -302,7 +220,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
302
220
  request
303
221
  }),
304
222
  load: async () => {
305
- const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-D0jbDypb.cjs"));
223
+ const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-C16UvawQ.cjs"));
306
224
  return msTeamsApprovalNativeRuntime;
307
225
  }
308
226
  });
@@ -409,12 +327,12 @@ function normalizeNullableString(value) {
409
327
  return trimmed ? trimmed : null;
410
328
  }
411
329
  /** Trims string input and returns undefined for non-strings or empty strings. */
412
- function normalizeOptionalString$3(value) {
330
+ function normalizeOptionalString$2(value) {
413
331
  return normalizeNullableString(value) ?? void 0;
414
332
  }
415
333
  /** Lowercases a normalized optional string. */
416
334
  function normalizeOptionalLowercaseString(value) {
417
- return normalizeOptionalString$3(value)?.toLowerCase();
335
+ return normalizeOptionalString$2(value)?.toLowerCase();
418
336
  }
419
337
  /** Lowercases a normalized string or returns an empty string when absent. */
420
338
  function normalizeLowercaseStringOrEmpty$1(value) {
@@ -440,7 +358,6 @@ function buildCanonicalPathCandidates(pathname) {
440
358
  const candidates = /* @__PURE__ */ new Set([normalizePathForSecurity(pathname)]);
441
359
  let decoded = pathname;
442
360
  let malformedEncoding = false;
443
- let decodePasses = 0;
444
361
  for (let pass = 0; pass < MAX_PATH_DECODE_PASSES; pass++) {
445
362
  let nextDecoded;
446
363
  try {
@@ -450,7 +367,6 @@ function buildCanonicalPathCandidates(pathname) {
450
367
  break;
451
368
  }
452
369
  if (nextDecoded === decoded) break;
453
- decodePasses += 1;
454
370
  decoded = nextDecoded;
455
371
  candidates.add(normalizePathForSecurity(decoded));
456
372
  }
@@ -462,17 +378,15 @@ function buildCanonicalPathCandidates(pathname) {
462
378
  }
463
379
  return {
464
380
  candidates: [...candidates],
465
- decodePasses,
466
381
  decodePassLimitReached,
467
382
  malformedEncoding
468
383
  };
469
384
  }
470
385
  function canonicalizePathForSecurity(pathname) {
471
- const { candidates, decodePasses, decodePassLimitReached, malformedEncoding } = buildCanonicalPathCandidates(pathname);
386
+ const { candidates, decodePassLimitReached, malformedEncoding } = buildCanonicalPathCandidates(pathname);
472
387
  return {
473
388
  canonicalPath: candidates[candidates.length - 1] ?? "/",
474
389
  candidates,
475
- decodePasses,
476
390
  decodePassLimitReached,
477
391
  malformedEncoding,
478
392
  rawNormalizedPath: normalizePathSeparators(normalizeLowercaseStringOrEmpty$1(pathname)) || "/"
@@ -516,30 +430,19 @@ var gateway_config_runtime_exports = /* @__PURE__ */ require_rolldown_runtime.__
516
430
  require_rolldown_runtime.__reExport(gateway_config_runtime_exports, require("openclaw/plugin-sdk/gateway-config-runtime"));
517
431
  //#endregion
518
432
  //#region extensions/msteams/src/webhook-route.ts
519
- const LEGACY_MESSAGES_PATH = "/api/messages";
520
- function listEnabledMSTeamsWebhookPaths(cfg) {
521
- return require_resolve_allowlist.listMSTeamsAccountIds(cfg).flatMap((accountId) => {
522
- const account = require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId);
523
- if (account.enabled === false) return [];
524
- const path = account.webhook?.path || LEGACY_MESSAGES_PATH;
525
- return [{
526
- accountId,
527
- path,
528
- canonical: resolvePluginRoutePathContext(path).canonicalPath
529
- }];
530
- });
531
- }
532
- /** Enabled account whose configured webhook path is /api/messages, if any. */
533
- function resolveMSTeamsLegacyMessagesOwner(cfg) {
534
- const legacy = resolvePluginRoutePathContext(LEGACY_MESSAGES_PATH).canonicalPath;
535
- return listEnabledMSTeamsWebhookPaths(cfg).find(({ canonical }) => canonical === legacy)?.accountId;
536
- }
537
433
  function resolveMSTeamsWebhookCollisionIssue(cfg) {
538
434
  const owners = /* @__PURE__ */ new Map();
539
- for (const { accountId, path, canonical } of listEnabledMSTeamsWebhookPaths(cfg)) {
540
- const owner = owners.get(canonical);
541
- if (owner && owner !== accountId) return "Microsoft Teams webhook path " + path + " is shared by accounts " + owner + " and " + accountId + ". Configure distinct webhook.path values.";
542
- owners.set(canonical, accountId);
435
+ for (const accountId of require_resolve_allowlist.listMSTeamsAccountIds(cfg)) {
436
+ const account = require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId);
437
+ if (account.enabled === false) continue;
438
+ const path = account.webhook?.path || "/api/messages";
439
+ const paths = accountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID && path !== "/api/messages" ? [path, "/api/messages"] : [path];
440
+ for (const routePath of paths) {
441
+ const canonical = resolvePluginRoutePathContext(routePath).canonicalPath;
442
+ const owner = owners.get(canonical);
443
+ if (owner && owner !== accountId) return "Microsoft Teams webhook path " + routePath + " is shared by accounts " + owner + " and " + accountId + ". Configure distinct webhook.path values.";
444
+ owners.set(canonical, accountId);
445
+ }
543
446
  }
544
447
  }
545
448
  function resolveMSTeamsLegacyWebhook(config) {
@@ -628,101 +531,6 @@ function withMSTeamsGraphMutationCurrentness(handleAction) {
628
531
  };
629
532
  }
630
533
  //#endregion
631
- //#region extensions/msteams/src/presentation.ts
632
- const MSTEAMS_PRESENTATION_CAPABILITIES = {
633
- supported: true,
634
- buttons: true,
635
- selects: false,
636
- context: true,
637
- divider: true,
638
- limits: {
639
- actions: {
640
- supportsStyles: false,
641
- supportsDisabled: false
642
- },
643
- text: { markdownDialect: "markdown" }
644
- }
645
- };
646
- function buildMSTeamsPresentationCard(params) {
647
- const body = [];
648
- const text = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.text);
649
- if (text) body.push({
650
- type: "TextBlock",
651
- text,
652
- wrap: true
653
- });
654
- const presentation = (0, openclaw_plugin_sdk_interactive_runtime.adaptMessagePresentationForChannel)({
655
- presentation: params.presentation,
656
- capabilities: MSTEAMS_PRESENTATION_CAPABILITIES
657
- });
658
- if (presentation.title) body.push({
659
- type: "TextBlock",
660
- text: presentation.title,
661
- weight: "Bolder",
662
- size: "Medium",
663
- wrap: true
664
- });
665
- const actions = [];
666
- for (const block of presentation.blocks) {
667
- if (block.type === "text" || block.type === "context") {
668
- body.push({
669
- type: "TextBlock",
670
- text: block.text,
671
- wrap: true,
672
- ...block.type === "context" ? {
673
- isSubtle: true,
674
- size: "Small"
675
- } : {}
676
- });
677
- continue;
678
- }
679
- if (block.type === "divider") {
680
- body.push({
681
- type: "TextBlock",
682
- text: "---",
683
- wrap: true,
684
- isSubtle: true
685
- });
686
- continue;
687
- }
688
- if (block.type === "buttons") for (const button of block.buttons) {
689
- const action = (0, openclaw_plugin_sdk_interactive_runtime.resolveMessagePresentationButtonAction)(button);
690
- if (action?.type === "url" || action?.type === "web-app") {
691
- const url = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(action.url);
692
- if (!url) continue;
693
- actions.push({
694
- type: "Action.OpenUrl",
695
- title: button.label,
696
- url
697
- });
698
- continue;
699
- }
700
- if (action?.type === "command") {
701
- actions.push({
702
- type: "Action.Submit",
703
- title: button.label,
704
- data: action.command
705
- });
706
- continue;
707
- }
708
- if (action?.type === "callback") actions.push({
709
- type: "Action.Submit",
710
- title: button.label,
711
- data: {
712
- value: action.value,
713
- label: button.label
714
- }
715
- });
716
- }
717
- }
718
- return {
719
- type: "AdaptiveCard",
720
- version: "1.4",
721
- body,
722
- ...actions.length ? { actions } : {}
723
- };
724
- }
725
- //#endregion
726
534
  //#region extensions/msteams/src/outbound-config.ts
727
535
  const MSTEAMS_TEXT_CHUNK_LIMIT = 4e3;
728
536
  function resolveMSTeamsEffectiveTextChunkLimit(configuredLimit) {
@@ -741,7 +549,7 @@ const msteamsOutboundConfig = {
741
549
  payload: true,
742
550
  messageSendingHooks: true
743
551
  } },
744
- presentationCapabilities: MSTEAMS_PRESENTATION_CAPABILITIES
552
+ presentationCapabilities: require_presentation.MSTEAMS_PRESENTATION_CAPABILITIES
745
553
  };
746
554
  //#endregion
747
555
  //#region extensions/msteams/src/read-policy.ts
@@ -776,9 +584,6 @@ function isCurrentMSTeamsReadTarget(params) {
776
584
  function normalizeUserTarget(target) {
777
585
  return target.replace(/^user:/i, "").trim().toLowerCase();
778
586
  }
779
- function isStableUserId(value) {
780
- return /^[0-9a-f-]{16,}$/i.test(value);
781
- }
782
587
  async function resolveDmTarget(cfg, accountId, target, directOperator = false) {
783
588
  const teams = cfg.channels?.msteams;
784
589
  if (teams?.dmPolicy === "disabled") return;
@@ -786,7 +591,7 @@ async function resolveDmTarget(cfg, accountId, target, directOperator = false) {
786
591
  if (!userId) return;
787
592
  const normalizedEntries = (directOperator ? [] : teams?.allowFrom ?? []).map((entry) => normalizeUserTarget(entry.replace(/^(msteams|teams):/i, "")));
788
593
  const allowAll = directOperator || (teams?.dmPolicy ?? "pairing") === "open" || normalizedEntries.includes("*");
789
- if (isStableUserId(userId)) return allowAll || normalizedEntries.some((entry) => entry === userId) ? `user:${userId}` : void 0;
594
+ if (/^[0-9a-f-]{16,}$/i.test(userId)) return allowAll || normalizedEntries.some((entry) => entry === userId) ? `user:${userId}` : void 0;
790
595
  if (!(0, openclaw_plugin_sdk_dangerous_name_runtime.isDangerousNameMatchingEnabled)(teams)) return;
791
596
  try {
792
597
  const [resolvedTarget, ...resolvedEntries] = await require_resolve_allowlist.resolveMSTeamsUserAllowlist({
@@ -853,7 +658,7 @@ async function resolveAllowedChannelTarget(cfg, accountId, target) {
853
658
  if (groupPolicy === "disabled") return;
854
659
  const [teamId, channelId] = target.split("/", 2);
855
660
  if (!teamId || !channelId) return;
856
- const directRoute = resolveMSTeamsRouteConfig({
661
+ const directRoute = require_presentation.resolveMSTeamsRouteConfig({
857
662
  cfg: teams,
858
663
  teamId,
859
664
  teamName: teamId,
@@ -874,7 +679,7 @@ async function isMappedChannelAllowed(cfg, accountId, teamId, conversationId) {
874
679
  if (!teams?.teams) return false;
875
680
  try {
876
681
  const botFrameworkTeamKey = await resolveConfiguredBotFrameworkTeamKey(cfg, accountId, teamId);
877
- if (botFrameworkTeamKey && resolveMSTeamsRouteConfig({
682
+ if (botFrameworkTeamKey && require_presentation.resolveMSTeamsRouteConfig({
878
683
  cfg: teams,
879
684
  teamId: botFrameworkTeamKey,
880
685
  conversationId
@@ -886,7 +691,7 @@ async function isMappedChannelAllowed(cfg, accountId, teamId, conversationId) {
886
691
  teamIdMode: "graph",
887
692
  teams: teams.teams
888
693
  });
889
- return resolveMSTeamsRouteConfig({
694
+ return require_presentation.resolveMSTeamsRouteConfig({
890
695
  cfg: {
891
696
  ...teams,
892
697
  teams: resolved.teams
@@ -930,7 +735,7 @@ async function assertMSTeamsTeamEnumerationAllowed(params) {
930
735
  const teams = cfg.channels?.msteams;
931
736
  const groupPolicy = resolveMSTeamsReadGroupPolicy(cfg);
932
737
  if (groupPolicy === "disabled") throw new openclaw_plugin_sdk_channel_actions.ToolAuthorizationError("Microsoft Teams channel list is not allowed.");
933
- const directRoute = resolveMSTeamsRouteConfig({
738
+ const directRoute = require_presentation.resolveMSTeamsRouteConfig({
934
739
  cfg: teams,
935
740
  teamId: params.teamId,
936
741
  teamName: params.teamId,
@@ -1016,7 +821,7 @@ const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.create
1016
821
  severity: "warn",
1017
822
  title: "MS Teams security warning"
1018
823
  });
1019
- const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-DeHVAVxL.cjs")), "msTeamsChannelRuntime");
824
+ const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-Ch2M_-jN.cjs")), "msTeamsChannelRuntime");
1020
825
  const MSTEAMS_REACTION_TYPES = [
1021
826
  "like",
1022
827
  "heart",
@@ -1045,12 +850,12 @@ function resolveGraphActionTarget(params, currentChannelId, currentGraphChannelI
1045
850
  }
1046
851
  function resolveMSTeamsActionMessage(ctx, to, allowCurrentMessageIdFallback = false) {
1047
852
  const canUseCurrentMessageId = allowCurrentMessageIdFallback && msteamsContextTargetsMatch(to, {
1048
- currentChannelId: ctx.toolContext?.currentChannelId ?? void 0,
853
+ currentChannelId: ctx.toolContext?.currentChannelId,
1049
854
  currentMessagingTarget: (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.toolContext?.currentGraphChannelId) ?? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.toolContext?.currentMessagingTarget)
1050
855
  });
1051
856
  const resolved = canUseCurrentMessageId ? (0, openclaw_plugin_sdk_channel_actions.resolveReactionMessageId)({
1052
857
  args: ctx.params,
1053
- toolContext: { currentMessageId: ctx.toolContext?.currentMessageId ?? void 0 }
858
+ toolContext: { currentMessageId: ctx.toolContext?.currentMessageId }
1054
859
  }) : (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(ctx.params.messageId) ?? "";
1055
860
  const messageId = resolved == null ? "" : String(resolved).trim();
1056
861
  const currentMessageId = ctx.toolContext?.currentMessageId;
@@ -1102,7 +907,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1102
907
  idleMs: 1e3
1103
908
  } },
1104
909
  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."] },
1105
- groups: { resolveToolPolicy: resolveMSTeamsGroupToolPolicy },
910
+ groups: { resolveToolPolicy: require_presentation.resolveMSTeamsGroupToolPolicy },
1106
911
  approvalCapability: msTeamsApprovalCapability,
1107
912
  doctor: msteamsDoctor,
1108
913
  messaging: {
@@ -1246,7 +1051,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1246
1051
  });
1247
1052
  const presentation = ctx.action === "send" ? (0, openclaw_plugin_sdk_interactive_runtime.normalizeMessagePresentation)(ctx.params.presentation) : void 0;
1248
1053
  if (ctx.action === "send" && presentation) {
1249
- const card = buildMSTeamsPresentationCard({
1054
+ const card = require_presentation.buildMSTeamsPresentationCard({
1250
1055
  presentation,
1251
1056
  text: resolveActionContent(ctx.params)
1252
1057
  });
@@ -1500,8 +1305,8 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1500
1305
  if (appId) lines.push({ text: `App: ${appId}` });
1501
1306
  const graph = probe?.graph;
1502
1307
  if (graph) {
1503
- const roles = Array.isArray(graph.roles) ? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(graph.roles) : [];
1504
- const scopes = Array.isArray(graph.scopes) ? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(graph.scopes) : [];
1308
+ const roles = graph.roles ?? [];
1309
+ const scopes = graph.scopes ?? [];
1505
1310
  const formatPermission = (permission) => {
1506
1311
  const hint = TEAMS_GRAPH_PERMISSION_HINTS[permission];
1507
1312
  return hint ? `${permission} (${hint})` : permission;
@@ -1525,7 +1330,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1525
1330
  })
1526
1331
  }),
1527
1332
  gateway: { startAccount: async (ctx) => {
1528
- const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./monitor-cuifGELM.cjs"));
1333
+ const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./monitor-b0zPpnmW.cjs"));
1529
1334
  const account = require_resolve_allowlist.resolveMSTeamsAccount({
1530
1335
  cfg: ctx.cfg,
1531
1336
  accountId: ctx.accountId
@@ -1602,12 +1407,6 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1602
1407
  outbound: msteamsChannelOutbound
1603
1408
  });
1604
1409
  //#endregion
1605
- Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
1606
- enumerable: true,
1607
- get: function() {
1608
- return buildMSTeamsPresentationCard;
1609
- }
1610
- });
1611
1410
  Object.defineProperty(exports, "inferMSTeamsTargetChatType", {
1612
1411
  enumerable: true,
1613
1412
  get: function() {
@@ -1638,30 +1437,12 @@ Object.defineProperty(exports, "resolveMSTeamsEffectiveTextChunkLimit", {
1638
1437
  return resolveMSTeamsEffectiveTextChunkLimit;
1639
1438
  }
1640
1439
  });
1641
- Object.defineProperty(exports, "resolveMSTeamsLegacyMessagesOwner", {
1642
- enumerable: true,
1643
- get: function() {
1644
- return resolveMSTeamsLegacyMessagesOwner;
1645
- }
1646
- });
1647
1440
  Object.defineProperty(exports, "resolveMSTeamsLegacyWebhook", {
1648
1441
  enumerable: true,
1649
1442
  get: function() {
1650
1443
  return resolveMSTeamsLegacyWebhook;
1651
1444
  }
1652
1445
  });
1653
- Object.defineProperty(exports, "resolveMSTeamsReplyPolicy", {
1654
- enumerable: true,
1655
- get: function() {
1656
- return resolveMSTeamsReplyPolicy;
1657
- }
1658
- });
1659
- Object.defineProperty(exports, "resolveMSTeamsRouteConfig", {
1660
- enumerable: true,
1661
- get: function() {
1662
- return resolveMSTeamsRouteConfig;
1663
- }
1664
- });
1665
1446
  Object.defineProperty(exports, "resolveMSTeamsWebhookCollisionIssue", {
1666
1447
  enumerable: true,
1667
1448
  get: function() {