@openclaw/msteams 2026.9.1-beta.1 → 2026.9.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 (26) hide show
  1. package/dist/{adapter.runtime-8g-MOPfb.cjs → adapter.runtime-DDuc7sKJ.cjs} +1 -1
  2. package/dist/api.cjs +2 -2
  3. package/dist/{approval-card-B6ZIMO83.cjs → approval-card-ClrTjCsL.cjs} +15 -5
  4. package/dist/{approval-handler.runtime-C3FXQ_6Z.cjs → approval-handler.runtime-9rMFhyLp.cjs} +9 -5
  5. package/dist/{channel-BsqcQ0E9.cjs → channel-CqRcu6kk.cjs} +22 -14
  6. package/dist/channel-config-api.cjs +1 -1
  7. package/dist/channel-plugin-api.cjs +1 -1
  8. package/dist/{channel.runtime-DuQWuKFd.cjs → channel.runtime-BAy59d1L.cjs} +64 -69
  9. package/dist/{channel.setup-BvYxZIFG.cjs → channel.setup-D2YO3F4O.cjs} +22 -18
  10. package/dist/{config-schema-C4CszdDi.cjs → config-schema-MyN2lamA.cjs} +12 -11
  11. package/dist/directory-contract-api.cjs +1 -1
  12. package/dist/doctor-contract-api.cjs +79 -42
  13. package/dist/{messenger-BJB30CC2.cjs → messenger-BvR2flEt.cjs} +23 -17
  14. package/dist/{oauth-BXQBTEta.cjs → oauth-BeROaYf0.cjs} +4 -3
  15. package/dist/{polls-DvuJvaDG.cjs → polls-P86qBpeV.cjs} +5 -4
  16. package/dist/qa-runner-api.cjs +1 -1
  17. package/dist/{reaction-types-dGkp4bkW.cjs → reaction-types-DcJBoyFP.cjs} +3 -2
  18. package/dist/{resolve-allowlist-B6FQAa3r.cjs → resolve-allowlist-CoKmLXYe.cjs} +37 -62
  19. package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
  20. package/dist/runtime-api.cjs +2 -1
  21. package/dist/{send-S0VPVSUi.cjs → send-CAKTR80N.cjs} +18 -14
  22. package/dist/setup-plugin-api.cjs +1 -1
  23. package/dist/{src-NMnaP_95.cjs → src-CyNCea9B.cjs} +124 -94
  24. package/dist/{sso-token-store-ChhO1f4i.cjs → sso-token-store-CNbRhz-A.cjs} +1 -1
  25. package/dist/{thread-session-DdWfgc8U.cjs → thread-session-p8FNgohv.cjs} +1 -1
  26. package/package.json +6 -6
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
2
  let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
3
3
  let node_crypto = require("node:crypto");
4
4
  let node_fs_promises = require("node:fs/promises");
package/dist/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_channel = require("./channel-BsqcQ0E9.cjs");
3
- const require_channel_setup = require("./channel.setup-BvYxZIFG.cjs");
2
+ const require_channel = require("./channel-CqRcu6kk.cjs");
3
+ const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
4
4
  exports.createMSTeamsSetupWizardBase = require_channel_setup.createMSTeamsSetupWizardBase;
5
5
  exports.msteamsPlugin = require_channel.msteamsPlugin;
6
6
  exports.msteamsSetupAdapter = require_channel_setup.msteamsSetupAdapter;
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
2
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
3
3
  let node_crypto = require("node:crypto");
4
4
  node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
@@ -71,6 +71,16 @@ function buildCardHeading(title, subtitle) {
71
71
  }];
72
72
  }
73
73
  function buildApprovalSubject(view) {
74
+ if (view.approvalKind === "system-agent") return [{
75
+ type: "TextBlock",
76
+ text: "Change",
77
+ weight: "Bolder",
78
+ wrap: true
79
+ }, {
80
+ type: "TextBlock",
81
+ text: view.operationSummary,
82
+ wrap: true
83
+ }];
74
84
  if (view.approvalKind === "exec") return [
75
85
  {
76
86
  type: "TextBlock",
@@ -141,7 +151,7 @@ function formatApprovalDecision(decision) {
141
151
  }
142
152
  function buildMSTeamsPendingApprovalCard(params) {
143
153
  const { view, nowMs } = params;
144
- const kindLabel = view.approvalKind === "plugin" ? "Plugin" : "Exec";
154
+ const kindLabel = view.approvalKind === "plugin" ? "Plugin" : view.approvalKind === "system-agent" ? "OpenClaw Change" : "Exec";
145
155
  const actionTokens = [];
146
156
  const actions = view.actions.map(({ decision, label }) => {
147
157
  const token = createMSTeamsApprovalToken();
@@ -174,17 +184,17 @@ function buildMSTeamsPendingApprovalCard(params) {
174
184
  };
175
185
  }
176
186
  function buildMSTeamsResolvedApprovalCard(view) {
177
- const kindLabel = view.approvalKind === "plugin" ? "Plugin" : "Exec";
187
+ const kindLabel = view.approvalKind === "plugin" ? "Plugin" : view.approvalKind === "system-agent" ? "OpenClaw Change" : "Exec";
178
188
  const resolvedBy = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(view.resolvedBy);
179
189
  return buildAdaptiveCard([
180
- ...buildCardHeading(`${kindLabel} Approval: ${formatApprovalDecision(view.decision)}`, resolvedBy ? `Resolved by ${resolvedBy}` : "Resolved"),
190
+ ...buildCardHeading(`${kindLabel} Approval: ${view.approvalKind === "system-agent" && view.terminalStatus === "cancelled" ? "Cancelled" : view.approvalKind === "system-agent" && view.applicationStatus === "applied" ? "Applied" : view.approvalKind === "system-agent" && view.applicationStatus === "not-applied" ? "Not applied" : formatApprovalDecision(view.decision)}`, resolvedBy ? `Resolved by ${resolvedBy}` : "Resolved"),
181
191
  ...buildApprovalSubject(view),
182
192
  buildApprovalMetadata(view.approvalId, view.metadata)
183
193
  ]);
184
194
  }
185
195
  function buildMSTeamsExpiredApprovalCard(view) {
186
196
  return buildAdaptiveCard([
187
- ...buildCardHeading(`${view.approvalKind === "plugin" ? "Plugin" : "Exec"} Approval Expired`, "This approval request expired before it was resolved."),
197
+ ...buildCardHeading(`${view.approvalKind === "plugin" ? "Plugin" : view.approvalKind === "system-agent" ? "OpenClaw Change" : "Exec"} Approval Expired`, "This approval request expired before it was resolved."),
188
198
  ...buildApprovalSubject(view),
189
199
  buildApprovalMetadata(view.approvalId, view.metadata)
190
200
  ]);
@@ -1,14 +1,18 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
2
- const require_channel = require("./channel-BsqcQ0E9.cjs");
3
- const require_approval_card = require("./approval-card-B6ZIMO83.cjs");
4
- const require_send = require("./send-S0VPVSUi.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
2
+ const require_channel = require("./channel-CqRcu6kk.cjs");
3
+ const require_approval_card = require("./approval-card-ClrTjCsL.cjs");
4
+ const require_send = require("./send-CAKTR80N.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");
8
8
  //#region extensions/msteams/src/approval-handler.runtime.ts
9
9
  const log = (0, require("openclaw/plugin-sdk/runtime-env").createSubsystemLogger)("msteams/approvals");
10
10
  const msTeamsApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_runtime.createChannelApprovalNativeRuntimeAdapter)({
11
- eventKinds: ["exec", "plugin"],
11
+ eventKinds: [
12
+ "exec",
13
+ "plugin",
14
+ "system-agent"
15
+ ],
12
16
  availability: {
13
17
  isConfigured: ({ cfg, accountId }) => require_channel.isMSTeamsNativeApprovalClientEnabled({
14
18
  cfg,
@@ -1,8 +1,8 @@
1
1
  require("./runtime-api.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
3
3
  const require_directory_contract_api = require("./directory-contract-api.cjs");
4
- const require_thread_session = require("./thread-session-DdWfgc8U.cjs");
5
- const require_channel_setup = require("./channel.setup-BvYxZIFG.cjs");
4
+ const require_thread_session = require("./thread-session-p8FNgohv.cjs");
5
+ const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
6
6
  let openclaw_plugin_sdk_approval_handler_adapter_runtime = require("openclaw/plugin-sdk/approval-handler-adapter-runtime");
7
7
  let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
8
8
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
@@ -105,18 +105,20 @@ function resolveMSTeamsRouteConfig(params) {
105
105
  const channelName = params.channelName?.trim();
106
106
  const teams = params.cfg?.teams ?? {};
107
107
  const allowlistConfigured = Object.keys(teams).length > 0;
108
+ const teamCandidates = (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(teamId, params.allowNameMatching ? teamName : void 0, params.allowNameMatching && teamName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(teamName) : void 0);
108
109
  const teamMatch = (0, openclaw_plugin_sdk_channel_targets.resolveChannelEntryMatchWithFallback)({
109
110
  entries: teams,
110
- keys: (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(teamId, params.allowNameMatching ? teamName : void 0, params.allowNameMatching && teamName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(teamName) : void 0),
111
+ keys: teamCandidates,
111
112
  wildcardKey: "*",
112
113
  normalizeKey: openclaw_plugin_sdk_channel_targets.normalizeChannelSlug
113
114
  });
114
115
  const teamConfig = teamMatch.entry;
115
116
  const channels = teamConfig?.channels ?? {};
116
117
  const channelAllowlistConfigured = Object.keys(channels).length > 0;
118
+ const channelCandidates = (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(conversationId, params.allowNameMatching ? channelName : void 0, params.allowNameMatching && channelName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(channelName) : void 0);
117
119
  const channelMatch = (0, openclaw_plugin_sdk_channel_targets.resolveChannelEntryMatchWithFallback)({
118
120
  entries: channels,
119
- keys: (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(conversationId, params.allowNameMatching ? channelName : void 0, params.allowNameMatching && channelName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(channelName) : void 0),
121
+ keys: channelCandidates,
120
122
  wildcardKey: "*",
121
123
  normalizeKey: openclaw_plugin_sdk_channel_targets.normalizeChannelSlug
122
124
  });
@@ -158,11 +160,12 @@ function resolveMSTeamsGroupToolPolicy(params) {
158
160
  });
159
161
  if (resolved !== void 0) return resolved;
160
162
  if (scope.path.length > 1) return;
163
+ const scanScope = resolveMSTeamsCrossTeamScanScope({
164
+ cfg,
165
+ groupId: params.groupId
166
+ });
161
167
  return (0, openclaw_plugin_sdk_channel_policy.resolveScopeToolsPolicy)({
162
- ...resolveMSTeamsCrossTeamScanScope({
163
- cfg,
164
- groupId: params.groupId
165
- }),
168
+ ...scanScope,
166
169
  ...senderScope
167
170
  });
168
171
  }
@@ -311,7 +314,11 @@ const resolveMSTeamsOriginTarget = (0, openclaw_plugin_sdk_approval_native_runti
311
314
  normalizeTarget: msTeamsApprovalTargetResolvers.normalizeTarget
312
315
  });
313
316
  const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_adapter_runtime.createLazyChannelApprovalNativeRuntimeAdapter)({
314
- eventKinds: ["exec", "plugin"],
317
+ eventKinds: [
318
+ "exec",
319
+ "plugin",
320
+ "system-agent"
321
+ ],
315
322
  isConfigured: ({ cfg, accountId }) => isMSTeamsNativeApprovalClientEnabled({
316
323
  cfg,
317
324
  accountId
@@ -323,7 +330,7 @@ const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handle
323
330
  request
324
331
  }),
325
332
  load: async () => {
326
- const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-C3FXQ_6Z.cjs"));
333
+ const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-9rMFhyLp.cjs"));
327
334
  return msTeamsApprovalNativeRuntime;
328
335
  }
329
336
  });
@@ -563,7 +570,8 @@ async function resolveConfiguredBotFrameworkTeamKey(cfg, graphTeamId) {
563
570
  if (!configuredTeams) return;
564
571
  const stableConfiguredKeys = Object.keys(configuredTeams).filter((teamKey) => teamKey !== "*" && /^19:.+@thread\./i.test(teamKey));
565
572
  if (stableConfiguredKeys.length === 0) return;
566
- const channelResult = await require_resolve_allowlist.listChannelsForTeamWithPageInfo(await require_resolve_allowlist.resolveGraphToken(cfg), graphTeamId);
573
+ const token = await require_resolve_allowlist.resolveGraphToken(cfg);
574
+ const channelResult = await require_resolve_allowlist.listChannelsForTeamWithPageInfo(token, graphTeamId);
567
575
  if (channelResult.truncated) return;
568
576
  const channelIds = new Set(channelResult.items.map((channel) => channel.id?.trim()).filter((channelId) => Boolean(channelId)));
569
577
  const matches = stableConfiguredKeys.filter((teamKey) => channelIds.has(teamKey));
@@ -773,7 +781,7 @@ const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.create
773
781
  severity: "critical",
774
782
  title: "MS Teams security warning"
775
783
  });
776
- const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-DuQWuKFd.cjs")), "msTeamsChannelRuntime");
784
+ const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-BAy59d1L.cjs")), "msTeamsChannelRuntime");
777
785
  function jsonActionResult(data) {
778
786
  return {
779
787
  content: [{
@@ -1516,7 +1524,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
1516
1524
  })
1517
1525
  }),
1518
1526
  gateway: { startAccount: async (ctx) => {
1519
- const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-NMnaP_95.cjs"));
1527
+ const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-CyNCea9B.cjs"));
1520
1528
  const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
1521
1529
  const statusSink = (0, openclaw_plugin_sdk_channel_outbound.createAccountStatusSink)({
1522
1530
  accountId: ctx.accountId,
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_config_schema = require("./config-schema-C4CszdDi.cjs");
2
+ const require_config_schema = require("./config-schema-MyN2lamA.cjs");
3
3
  exports.MSTeamsChannelConfigSchema = require_config_schema.MSTeamsChannelConfigSchema;
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_channel = require("./channel-BsqcQ0E9.cjs");
2
+ const require_channel = require("./channel-CqRcu6kk.cjs");
3
3
  exports.msteamsPlugin = require_channel.msteamsPlugin;
@@ -1,10 +1,10 @@
1
1
  require("./runtime-api.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
3
- const require_channel = require("./channel-BsqcQ0E9.cjs");
4
- const require_channel_setup = require("./channel.setup-BvYxZIFG.cjs");
5
- const require_polls = require("./polls-DvuJvaDG.cjs");
6
- const require_send = require("./send-S0VPVSUi.cjs");
7
- const require_reaction_types = require("./reaction-types-dGkp4bkW.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
3
+ const require_channel = require("./channel-CqRcu6kk.cjs");
4
+ const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
5
+ const require_polls = require("./polls-P86qBpeV.cjs");
6
+ const require_send = require("./send-CAKTR80N.cjs");
7
+ const require_reaction_types = require("./reaction-types-DcJBoyFP.cjs");
8
8
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
9
9
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
10
10
  let openclaw_plugin_sdk_reply_payload = require("openclaw/plugin-sdk/reply-payload");
@@ -16,10 +16,12 @@ let openclaw_plugin_sdk_string_normalization_runtime = require("openclaw/plugin-
16
16
  async function listMSTeamsDirectoryPeersLive(params) {
17
17
  const query = require_resolve_allowlist.normalizeQuery(params.query);
18
18
  if (!query) return [];
19
+ const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
20
+ const limit = typeof params.limit === "number" && params.limit > 0 ? params.limit : 20;
19
21
  return (await require_resolve_allowlist.searchGraphUsers({
20
- token: await require_resolve_allowlist.resolveGraphToken(params.cfg),
22
+ token,
21
23
  query,
22
- top: typeof params.limit === "number" && params.limit > 0 ? params.limit : 20
24
+ top: limit
23
25
  })).map((user) => {
24
26
  const id = user.id?.trim();
25
27
  if (!id) return null;
@@ -132,9 +134,10 @@ function resolveConversationPath(to) {
132
134
  async function getMessageMSTeams(params) {
133
135
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
134
136
  const { basePath } = resolveConversationPath(await resolveGraphConversationId(params.to));
137
+ const path = `${basePath}/messages/${encodeURIComponent(params.messageId)}`;
135
138
  const msg = await require_resolve_allowlist.fetchGraphJson({
136
139
  token,
137
- path: `${basePath}/messages/${encodeURIComponent(params.messageId)}`
140
+ path
138
141
  });
139
142
  return {
140
143
  id: msg.id ?? params.messageId,
@@ -182,9 +185,10 @@ async function unpinMessageMSTeams(params) {
182
185
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
183
186
  const conv = resolveConversationPath(await resolveGraphConversationId(params.to));
184
187
  if (conv.kind === "channel") throw new Error("Pin/unpin is not supported for channel messages on Graph v1.0. Only chat conversations support pinned messages.");
188
+ const path = `${conv.basePath}/pinnedMessages/${encodeURIComponent(params.pinnedMessageId)}`;
185
189
  await require_resolve_allowlist.deleteGraphRequest({
186
190
  token,
187
- path: `${conv.basePath}/pinnedMessages/${encodeURIComponent(params.pinnedMessageId)}`
191
+ path
188
192
  });
189
193
  return { ok: true };
190
194
  }
@@ -237,9 +241,10 @@ async function reactMessageMSTeams(params) {
237
241
  const reactionType = require_reaction_types.resolveMSTeamsReactionEmoji(params.reactionType);
238
242
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { preferDelegated: true });
239
243
  const { basePath } = resolveConversationPath(await resolveGraphConversationId(params.to));
244
+ const path = `${basePath}/messages/${encodeURIComponent(params.messageId)}/setReaction`;
240
245
  await require_resolve_allowlist.mutateGraphJson({
241
246
  token,
242
- path: `${basePath}/messages/${encodeURIComponent(params.messageId)}/setReaction`,
247
+ path,
243
248
  method: "POST",
244
249
  body: { reactionType },
245
250
  beta: true
@@ -256,9 +261,10 @@ async function unreactMessageMSTeams(params) {
256
261
  const reactionType = require_reaction_types.resolveMSTeamsReactionEmoji(params.reactionType);
257
262
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { preferDelegated: true });
258
263
  const { basePath } = resolveConversationPath(await resolveGraphConversationId(params.to));
264
+ const path = `${basePath}/messages/${encodeURIComponent(params.messageId)}/unsetReaction`;
259
265
  await require_resolve_allowlist.mutateGraphJson({
260
266
  token,
261
- path: `${basePath}/messages/${encodeURIComponent(params.messageId)}/unsetReaction`,
267
+ path,
262
268
  method: "POST",
263
269
  body: { reactionType },
264
270
  beta: true
@@ -272,9 +278,10 @@ async function unreactMessageMSTeams(params) {
272
278
  async function listReactionsMSTeams(params) {
273
279
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
274
280
  const { basePath } = resolveConversationPath(await resolveGraphConversationId(params.to));
281
+ const path = `${basePath}/messages/${encodeURIComponent(params.messageId)}`;
275
282
  const msg = await require_resolve_allowlist.fetchGraphJson({
276
283
  token,
277
- path: `${basePath}/messages/${encodeURIComponent(params.messageId)}`
284
+ path
278
285
  });
279
286
  const grouped = /* @__PURE__ */ new Map();
280
287
  for (const reaction of msg.reactions ?? []) {
@@ -355,7 +362,7 @@ async function searchMessagesMSTeams(params) {
355
362
  messages,
356
363
  truncated: false
357
364
  };
358
- truncated = page === SEARCH_MAX_PAGES - 1;
365
+ truncated = page === 9;
359
366
  }
360
367
  return {
361
368
  messages,
@@ -369,23 +376,18 @@ async function findMSTeamsConversationMember(params) {
369
376
  const conversationId = await resolveGraphConversationId(params.to);
370
377
  const conversation = resolveConversationPath(conversationId);
371
378
  const collection = conversation.kind === "channel" && params.includeIndirectChannelMembers ? "allMembers" : "members";
372
- let nextPath = `${conversation.basePath}/${collection}`;
373
- let pages = 0;
374
- let member;
375
- while (nextPath && pages < MAX_CONVERSATION_MEMBER_PAGES && !member) {
376
- const response = await require_resolve_allowlist.fetchGraphJson({
377
- token: params.token,
378
- path: nextPath
379
- });
380
- const userId = params.userId.trim().toLowerCase();
381
- member = (response.value ?? []).find((candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId);
382
- nextPath = response["@odata.nextLink"]?.replace("https://graph.microsoft.com/v1.0", "");
383
- pages += 1;
384
- }
385
- if (nextPath && !member) throw new Error("MS Teams conversation member pagination limit exceeded");
379
+ const userId = params.userId.trim().toLowerCase();
380
+ const result = await require_resolve_allowlist.fetchAllGraphPages({
381
+ token: params.token,
382
+ path: `${conversation.basePath}/${collection}`,
383
+ maxPages: MAX_CONVERSATION_MEMBER_PAGES,
384
+ collectItems: false,
385
+ findOne: (candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId
386
+ });
387
+ if (result.truncated) throw new Error("MS Teams conversation member pagination limit exceeded");
386
388
  return {
387
389
  conversationId,
388
- member
390
+ member: result.found
389
391
  };
390
392
  }
391
393
  //#endregion
@@ -436,9 +438,10 @@ async function removeParticipantMSTeams(params) {
436
438
  userId: params.userId
437
439
  });
438
440
  if (!member?.id) throw new Error(`User ${params.userId} is not a member of this conversation`);
441
+ const conv = resolveConversationPath(conversationId);
439
442
  await require_resolve_allowlist.deleteGraphRequest({
440
443
  token,
441
- path: `${resolveConversationPath(conversationId).basePath}/members/${encodeURIComponent(member.id)}`
444
+ path: `${conv.basePath}/members/${encodeURIComponent(member.id)}`
442
445
  });
443
446
  return { removed: {
444
447
  userId: params.userId,
@@ -478,19 +481,15 @@ async function findStandardChannelMember(params) {
478
481
  path: `${conversation.basePath}?$select=membershipType`
479
482
  })).membershipType !== "standard") throw new Error("Microsoft Teams member-info requires a standard channel when using the configured permission baseline.");
480
483
  const requestedUserId = normalizeUserId(params.userId);
481
- let nextPath = `/teams/${encodeURIComponent(conversation.teamId)}/members`;
482
- let pages = 0;
483
- while (nextPath && pages < MAX_TEAM_MEMBER_PAGES) {
484
- const response = await require_resolve_allowlist.fetchGraphJson({
485
- token: params.token,
486
- path: nextPath
487
- });
488
- const member = (response.value ?? []).find((candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId);
489
- if (member) return member;
490
- nextPath = response["@odata.nextLink"]?.replace("https://graph.microsoft.com/v1.0", "");
491
- pages += 1;
492
- }
493
- if (nextPath) throw new Error("Microsoft Teams team member pagination limit exceeded");
484
+ const result = await require_resolve_allowlist.fetchAllGraphPages({
485
+ token: params.token,
486
+ path: `/teams/${encodeURIComponent(conversation.teamId)}/members`,
487
+ maxPages: MAX_TEAM_MEMBER_PAGES,
488
+ collectItems: false,
489
+ findOne: (candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId
490
+ });
491
+ if (result.truncated) throw new Error("Microsoft Teams team member pagination limit exceeded");
492
+ return result.found;
494
493
  }
495
494
  /**
496
495
  * Fetch a user profile from Microsoft Graph by user ID.
@@ -530,29 +529,19 @@ async function getMemberInfoMSTeams(params) {
530
529
  */
531
530
  async function listChannelsMSTeams(params) {
532
531
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
533
- const firstPath = `/teams/${encodeURIComponent(params.teamId)}/channels?$select=id,displayName,description,membershipType`;
534
- const collected = [];
535
- let nextPath = firstPath;
536
- const MAX_PAGES = 10;
537
- let page = 0;
538
- while (nextPath && page < MAX_PAGES) {
539
- const res = await require_resolve_allowlist.fetchGraphJson({
540
- token,
541
- path: nextPath
542
- });
543
- collected.push(...res.value ?? []);
544
- const nextLink = res["@odata.nextLink"];
545
- nextPath = nextLink ? nextLink.replace("https://graph.microsoft.com/v1.0", "") : void 0;
546
- page++;
547
- }
532
+ const result = await require_resolve_allowlist.fetchAllGraphPages({
533
+ token,
534
+ path: `/teams/${encodeURIComponent(params.teamId)}/channels?$select=id,displayName,description,membershipType`,
535
+ maxPages: 10
536
+ });
548
537
  return {
549
- channels: collected.map((ch) => ({
538
+ channels: result.items.map((ch) => ({
550
539
  id: ch.id,
551
540
  displayName: ch.displayName,
552
541
  description: ch.description,
553
542
  membershipType: ch.membershipType
554
543
  })),
555
- truncated: Boolean(nextPath)
544
+ truncated: result.truncated
556
545
  };
557
546
  }
558
547
  /**
@@ -560,9 +549,11 @@ async function listChannelsMSTeams(params) {
560
549
  * Returns id, displayName, description, membershipType, webUrl, and createdDateTime.
561
550
  */
562
551
  async function getChannelInfoMSTeams(params) {
552
+ const token = await require_resolve_allowlist.resolveGraphToken(params.cfg);
553
+ const path = `/teams/${encodeURIComponent(params.teamId)}/channels/${encodeURIComponent(params.channelId)}?$select=id,displayName,description,membershipType,webUrl,createdDateTime`;
563
554
  const ch = await require_resolve_allowlist.fetchGraphJson({
564
- token: await require_resolve_allowlist.resolveGraphToken(params.cfg),
565
- path: `/teams/${encodeURIComponent(params.teamId)}/channels/${encodeURIComponent(params.channelId)}?$select=id,displayName,description,membershipType,webUrl,createdDateTime`
555
+ token,
556
+ path
566
557
  });
567
558
  return { channel: {
568
559
  id: ch.id,
@@ -646,11 +637,14 @@ const msteamsOutbound = {
646
637
  sendPayload: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, payload, deps, onDeliveryResult, threadId }) => {
647
638
  const deliveryTarget = resolveMSTeamsThreadTarget(to, threadId);
648
639
  const presentationCard = (0, openclaw_plugin_sdk_string_coerce_runtime.asOptionalRecord)(payload.channelData?.msteams)?.presentationCard;
649
- if (presentationCard && typeof presentationCard === "object" && !Array.isArray(presentationCard)) return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(await require_send.sendAdaptiveCardMSTeams({
650
- cfg,
651
- to: deliveryTarget,
652
- card: presentationCard
653
- })));
640
+ if (presentationCard && typeof presentationCard === "object" && !Array.isArray(presentationCard)) {
641
+ const result = await require_send.sendAdaptiveCardMSTeams({
642
+ cfg,
643
+ to: deliveryTarget,
644
+ card: presentationCard
645
+ });
646
+ return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", toMSTeamsOutboundResult(result));
647
+ }
654
648
  const mediaUrls = (0, openclaw_plugin_sdk_string_normalization_runtime.normalizeStringEntries)((0, openclaw_plugin_sdk_reply_payload.resolvePayloadMediaUrls)({
655
649
  ...payload,
656
650
  mediaUrl: payload.mediaUrl ?? mediaUrl
@@ -772,10 +766,11 @@ async function probeMSTeams(cfg) {
772
766
  })) throw new Error("Failed to acquire bot token");
773
767
  let graph;
774
768
  try {
775
- const accessToken = require_resolve_allowlist.readAccessToken(await require_resolve_allowlist.withMSTeamsRequestDeadline({
769
+ const graphTokenValue = await require_resolve_allowlist.withMSTeamsRequestDeadline({
776
770
  label: "MS Teams Graph probe token",
777
771
  work: () => tokenProvider.getAccessToken("https://graph.microsoft.com")
778
- }));
772
+ });
773
+ const accessToken = require_resolve_allowlist.readAccessToken(graphTokenValue);
779
774
  const payload = accessToken ? decodeJwtPayload(accessToken) : null;
780
775
  graph = {
781
776
  ok: true,
@@ -1,13 +1,13 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
2
2
  require("./secret-input-C65t6kjM.cjs");
3
- const require_config_schema = require("./config-schema-C4CszdDi.cjs");
3
+ const require_config_schema = require("./config-schema-MyN2lamA.cjs");
4
4
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
5
5
  let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
6
6
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
7
+ let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
7
8
  let openclaw_plugin_sdk_number_runtime = require("openclaw/plugin-sdk/number-runtime");
8
9
  let openclaw_plugin_sdk_channel_config_helpers = require("openclaw/plugin-sdk/channel-config-helpers");
9
10
  let openclaw_plugin_sdk_secret_file_runtime = require("openclaw/plugin-sdk/secret-file-runtime");
10
- let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
11
11
  let openclaw_plugin_sdk_channel_setup = require("openclaw/plugin-sdk/channel-setup");
12
12
  let openclaw_plugin_sdk_setup = require("openclaw/plugin-sdk/setup");
13
13
  let openclaw_plugin_sdk_setup_tools = require("openclaw/plugin-sdk/setup-tools");
@@ -107,16 +107,17 @@ function createMSTeamsSetupWizardBase() {
107
107
  let appPassword = null;
108
108
  let tenantId = null;
109
109
  if (!resolved && !hasConfigCreds) await noteMSTeamsCredentialHelp(prompter);
110
- if (canUseEnv || hasConfigCreds) if (await prompter.confirm({
111
- message: t$1(canUseEnv ? "wizard.msteams.envPrompt" : "wizard.msteams.credentialsKeep"),
112
- initialValue: true
113
- })) next = msteamsSetupAdapter.applyAccountConfig({
114
- cfg: next,
115
- accountId: openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID,
116
- input: {}
117
- });
118
- else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
119
- else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
110
+ if (canUseEnv || hasConfigCreds) {
111
+ if (await prompter.confirm({
112
+ message: t$1(canUseEnv ? "wizard.msteams.envPrompt" : "wizard.msteams.credentialsKeep"),
113
+ initialValue: true
114
+ })) next = msteamsSetupAdapter.applyAccountConfig({
115
+ cfg: next,
116
+ accountId: openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID,
117
+ input: {}
118
+ });
119
+ else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
120
+ } else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
120
121
  if (appId && appPassword && tenantId) next = {
121
122
  ...next,
122
123
  channels: {
@@ -190,7 +191,8 @@ function extractErrorCode(err) {
190
191
  }
191
192
  function extractRetryAfterMs(err) {
192
193
  if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(err)) return null;
193
- const directMs = (0, openclaw_plugin_sdk_number_runtime.asFiniteNumberInRange)(err.retryAfterMs ?? err.retry_after_ms, {
194
+ const direct = err.retryAfterMs ?? err.retry_after_ms;
195
+ const directMs = (0, openclaw_plugin_sdk_number_runtime.asFiniteNumberInRange)(direct, {
194
196
  min: 0,
195
197
  max: Number.MAX_SAFE_INTEGER
196
198
  });
@@ -337,12 +339,13 @@ async function promptMSTeamsAllowFrom(params) {
337
339
  "- 00000000-0000-0000-0000-000000000000"
338
340
  ].join("\n"), t("wizard.msteams.allowlistTitle"));
339
341
  while (true) {
340
- const parts = (0, openclaw_plugin_sdk_setup.splitSetupEntries)(await params.prompter.text({
342
+ const entry = await params.prompter.text({
341
343
  message: t("wizard.msteams.allowFromPrompt"),
342
344
  placeholder: "alex@example.com, Alex Johnson",
343
345
  initialValue: existing[0] ? existing[0] : void 0,
344
346
  validate: (value) => value.trim() ? void 0 : t("common.required")
345
- }));
347
+ });
348
+ const parts = (0, openclaw_plugin_sdk_setup.splitSetupEntries)(entry);
346
349
  if (parts.length === 0) {
347
350
  await params.prompter.note(t("wizard.msteams.enterAtLeastOneUser"), t("wizard.msteams.allowlistTitle"));
348
351
  continue;
@@ -365,7 +368,8 @@ async function promptMSTeamsAllowFrom(params) {
365
368
  await params.prompter.note(t("wizard.msteams.couldNotResolve", { entries: unresolved.map((item) => item.input).join(", ") }), t("wizard.msteams.allowlistTitle"));
366
369
  continue;
367
370
  }
368
- const unique = (0, openclaw_plugin_sdk_setup.mergeAllowFromEntries)(existing, resolved.map((item) => item.id));
371
+ const ids = resolved.map((item) => item.id);
372
+ const unique = (0, openclaw_plugin_sdk_setup.mergeAllowFromEntries)(existing, ids);
369
373
  return setMSTeamsAllowFrom(params.cfg, unique);
370
374
  }
371
375
  }
@@ -479,7 +483,7 @@ const msteamsSetupWizard = {
479
483
  };
480
484
  let oauthModule;
481
485
  try {
482
- oauthModule = await Promise.resolve().then(() => require("./oauth-BXQBTEta.cjs"));
486
+ oauthModule = await Promise.resolve().then(() => require("./oauth-BeROaYf0.cjs"));
483
487
  } catch (err) {
484
488
  await noteDelegatedAuthFailure(err);
485
489
  return {
@@ -80,18 +80,19 @@ function isAzureChinaBotFrameworkServiceUrl(value) {
80
80
  return false;
81
81
  }
82
82
  }
83
+ const { accountShape, rootPolicyShape } = (0, openclaw_plugin_sdk_channel_config_schema.buildChannelAccountSchemaParts)({
84
+ omit: [
85
+ "name",
86
+ "mentionPatterns",
87
+ "replyToMode"
88
+ ],
89
+ allowFrom: zod.z.array(zod.z.string()).optional(),
90
+ groupAllowFrom: zod.z.array(zod.z.string()).optional(),
91
+ streaming: openclaw_plugin_sdk_channel_config_schema.ChannelPreviewStreamingConfigSchema.optional()
92
+ });
83
93
  const MSTeamsConfigSchema = zod.z.object({
84
- ...(0, openclaw_plugin_sdk_channel_config_schema.buildCommonChannelAccountShape)({
85
- useDefaults: true,
86
- omit: [
87
- "name",
88
- "mentionPatterns",
89
- "replyToMode"
90
- ],
91
- allowFrom: zod.z.array(zod.z.string()).optional(),
92
- groupAllowFrom: zod.z.array(zod.z.string()).optional(),
93
- streaming: openclaw_plugin_sdk_channel_config_schema.ChannelPreviewStreamingConfigSchema.optional()
94
- }),
94
+ ...accountShape,
95
+ ...rootPolicyShape,
95
96
  dangerouslyAllowNameMatching: openclaw_plugin_sdk_channel_config_schema.ChannelDangerouslyAllowNameMatchingSchema,
96
97
  appId: zod.z.string().optional(),
97
98
  appPassword: (0, openclaw_plugin_sdk_secret_input.registerSensitiveConfigSchema)(SecretInputSchema.optional()),
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
3
3
  let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
4
4
  const msteamsDirectoryContractPlugin = {
5
5
  id: "msteams",