@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
@@ -1,12 +1,13 @@
1
- const require_token_config = require("./token-config-bEpua_Q7.cjs");
2
- const require_resolve_allowlist = require("./resolve-allowlist-gI34MnpE.cjs");
1
+ const require_token_config = require("./token-config-DICiuJWr.cjs");
2
+ const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
3
3
  require("../runtime-api.cjs");
4
- const require_delegated_state = require("./delegated-state-Bv5cWuec.cjs");
5
- const require_channel = require("./channel-Ci6K9Njb.cjs");
6
- const require_channel_setup = require("./channel.setup-BN3uhq3r.cjs");
7
- const require_conversation_store_state = require("./conversation-store-state-B-4g4uq5.cjs");
8
- const require_send = require("./send-C9JY42T6.cjs");
9
- const require_reaction_types = require("./reaction-types-CwP5RVQB.cjs");
4
+ const require_delegated_state = require("./delegated-state-ilYzKwD8.cjs");
5
+ const require_channel = require("./channel-BaTw0JW3.cjs");
6
+ const require_presentation = require("./presentation-Duoi9Ijn.cjs");
7
+ const require_channel_setup = require("./channel.setup-B9yKGEse.cjs");
8
+ const require_conversation_store_state = require("./conversation-store-state-CVhMM0QY.cjs");
9
+ const require_send = require("./send-D1w7a_ip.cjs");
10
+ const require_reaction_types = require("./reaction-types-C6F6g2nk.cjs");
10
11
  let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
11
12
  let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
12
13
  let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
@@ -18,10 +19,10 @@ let openclaw_plugin_sdk_string_normalization_runtime = require("openclaw/plugin-
18
19
  let openclaw_plugin_sdk_text_chunking = require("openclaw/plugin-sdk/text-chunking");
19
20
  //#region extensions/msteams/src/directory-live.ts
20
21
  async function listMSTeamsDirectoryPeersLive(params) {
21
- const query = require_resolve_allowlist.normalizeQuery(params.query);
22
+ const query = params.query?.trim() ?? "";
22
23
  if (!query) return [];
23
24
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId });
24
- const limit = typeof params.limit === "number" && params.limit > 0 ? params.limit : 20;
25
+ const limit = params.limit != null && params.limit > 0 ? params.limit : 20;
25
26
  return (await require_resolve_allowlist.searchGraphUsers({
26
27
  token,
27
28
  query,
@@ -41,13 +42,13 @@ async function listMSTeamsDirectoryPeersLive(params) {
41
42
  });
42
43
  }
43
44
  async function listMSTeamsDirectoryGroupsLive(params) {
44
- const rawQuery = require_resolve_allowlist.normalizeQuery(params.query);
45
+ const rawQuery = params.query?.trim() ?? "";
45
46
  if (!rawQuery) return [];
46
47
  const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId });
47
- const limit = typeof params.limit === "number" && params.limit > 0 ? params.limit : 20;
48
+ const limit = params.limit != null && params.limit > 0 ? params.limit : 20;
48
49
  const [teamQuery, channelQuery] = rawQuery.includes("/") ? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(rawQuery.split("/", 2)) : [rawQuery, null];
49
50
  const normalizedChannelQuery = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(channelQuery);
50
- const teams = await require_resolve_allowlist.listTeamsByName(token, teamQuery);
51
+ const { items: teams } = await require_resolve_allowlist.listTeamsByNameWithPageInfo(token, teamQuery);
51
52
  const results = [];
52
53
  for (const team of teams) {
53
54
  const teamId = team.id?.trim();
@@ -64,7 +65,7 @@ async function listMSTeamsDirectoryGroupsLive(params) {
64
65
  if (results.length >= limit) return results;
65
66
  continue;
66
67
  }
67
- const channels = await require_resolve_allowlist.listChannelsForTeam(token, teamId);
68
+ const { items: channels } = await require_resolve_allowlist.listChannelsForTeamWithPageInfo(token, teamId);
68
69
  for (const channel of channels) {
69
70
  const name = channel.displayName?.trim();
70
71
  if (!name) continue;
@@ -112,14 +113,12 @@ function resolveConversationPath(to) {
112
113
  return {
113
114
  kind: "channel",
114
115
  basePath: `/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}`,
115
- teamId,
116
- channelId
116
+ teamId
117
117
  };
118
118
  }
119
119
  return {
120
120
  kind: "chat",
121
- basePath: `/chats/${encodeURIComponent(cleaned)}`,
122
- chatId: cleaned
121
+ basePath: `/chats/${encodeURIComponent(cleaned)}`
123
122
  };
124
123
  }
125
124
  async function resolveGraphMessageContext(params, options) {
@@ -185,29 +184,17 @@ async function unpinMessageMSTeams(params) {
185
184
  const LIST_PINS_MAX_PAGES = 10;
186
185
  async function listPinsMSTeams(params) {
187
186
  const { token, basePath } = await resolveGraphPinContext(params, "list");
188
- const path = `${basePath}/pinnedMessages?$expand=message`;
189
- const allPins = [];
190
- let res = await require_resolve_allowlist.fetchGraphJson({
187
+ const { items } = await require_resolve_allowlist.fetchAllGraphPages({
191
188
  token,
192
- path
189
+ path: `${basePath}/pinnedMessages?$expand=message`,
190
+ maxPages: LIST_PINS_MAX_PAGES
193
191
  });
194
- let pages = 1;
195
- while (true) {
196
- for (const pin of res.value ?? []) allPins.push({
197
- id: pin.id ?? "",
198
- pinnedMessageId: pin.id ?? "",
199
- messageId: pin.message?.id,
200
- text: pin.message?.body?.content
201
- });
202
- const nextLink = res["@odata.nextLink"];
203
- if (!nextLink || pages >= LIST_PINS_MAX_PAGES) break;
204
- res = await require_resolve_allowlist.fetchGraphAbsoluteUrl({
205
- token,
206
- url: nextLink
207
- });
208
- pages++;
209
- }
210
- return { pins: allPins };
192
+ return { pins: items.map((pin) => ({
193
+ id: pin.id ?? "",
194
+ pinnedMessageId: pin.id ?? "",
195
+ messageId: pin.message?.id,
196
+ text: pin.message?.body?.content
197
+ })) };
211
198
  }
212
199
  async function mutateMessageReaction(params, operation) {
213
200
  const reactionType = require_reaction_types.resolveMSTeamsReactionEmoji(params.reactionType);
@@ -325,30 +312,8 @@ async function searchMessagesMSTeams(params) {
325
312
  };
326
313
  }
327
314
  //#endregion
328
- //#region extensions/msteams/src/graph-conversation-members.ts
329
- const MAX_CONVERSATION_MEMBER_PAGES = 100;
330
- async function findMSTeamsConversationMember(params) {
331
- const conversationId = await resolveGraphConversationId(params.to, {
332
- cfg: params.cfg,
333
- accountId: params.accountId
334
- });
335
- const conversation = resolveConversationPath(conversationId);
336
- const userId = params.userId.trim().toLowerCase();
337
- const result = await require_resolve_allowlist.fetchAllGraphPages({
338
- token: params.token,
339
- path: `${conversation.basePath}/members`,
340
- maxPages: MAX_CONVERSATION_MEMBER_PAGES,
341
- collectItems: false,
342
- findOne: (candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId
343
- });
344
- if (result.truncated) throw new Error("MS Teams conversation member pagination limit exceeded");
345
- return {
346
- conversationId,
347
- member: result.found
348
- };
349
- }
350
- //#endregion
351
315
  //#region extensions/msteams/src/graph-group-management.ts
316
+ const MAX_CONVERSATION_MEMBER_PAGES = 100;
352
317
  function resolveConversationMemberRoles(role, kind) {
353
318
  const normalized = role?.trim().toLowerCase() || "member";
354
319
  if (normalized !== "member" && normalized !== "owner") throw new Error("MS Teams participant role must be \"member\" or \"owner\".");
@@ -378,19 +343,21 @@ async function addParticipantMSTeams(params) {
378
343
  * Lists members first to resolve the membership ID, then deletes.
379
344
  */
380
345
  async function removeParticipantMSTeams(params) {
381
- const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId });
382
- const { conversationId, member } = await findMSTeamsConversationMember({
346
+ const { token, conversationId, basePath } = await resolveGraphMessageContext(params);
347
+ const userId = params.userId.trim().toLowerCase();
348
+ const result = await require_resolve_allowlist.fetchAllGraphPages({
383
349
  token,
384
- to: params.to,
385
- cfg: params.cfg,
386
- accountId: params.accountId,
387
- userId: params.userId
350
+ path: `${basePath}/members`,
351
+ maxPages: MAX_CONVERSATION_MEMBER_PAGES,
352
+ collectItems: false,
353
+ findOne: (candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId
388
354
  });
355
+ if (result.truncated) throw new Error("MS Teams conversation member pagination limit exceeded");
356
+ const member = result.found;
389
357
  if (!member?.id) throw new Error(`User ${params.userId} is not a member of this conversation`);
390
- const conv = resolveConversationPath(conversationId);
391
358
  await require_resolve_allowlist.deleteGraphRequest({
392
359
  token,
393
- path: `${conv.basePath}/members/${encodeURIComponent(member.id)}`
360
+ path: `${basePath}/members/${encodeURIComponent(member.id)}`
394
361
  });
395
362
  return { removed: {
396
363
  userId: params.userId,
@@ -417,24 +384,6 @@ const MAX_TEAM_MEMBER_PAGES = 100;
417
384
  function normalizeUserId(value) {
418
385
  return value?.replace(/^(msteams|teams|user):/i, "").trim().toLowerCase() ?? "";
419
386
  }
420
- async function findStandardChannelMember(params) {
421
- const { conversation } = params;
422
- if (conversation.kind !== "channel" || !conversation.teamId) return;
423
- if ((await require_resolve_allowlist.fetchGraphJson({
424
- token: params.token,
425
- path: `${conversation.basePath}?$select=membershipType`
426
- })).membershipType !== "standard") throw new Error("Microsoft Teams member-info requires a standard channel when using the configured permission baseline.");
427
- const requestedUserId = normalizeUserId(params.userId);
428
- const result = await require_resolve_allowlist.fetchAllGraphPages({
429
- token: params.token,
430
- path: `/teams/${encodeURIComponent(conversation.teamId)}/members`,
431
- maxPages: MAX_TEAM_MEMBER_PAGES,
432
- collectItems: false,
433
- findOne: (candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId
434
- });
435
- if (result.truncated) throw new Error("Microsoft Teams team member pagination limit exceeded");
436
- return result.found;
437
- }
438
387
  async function getMemberInfoMSTeams(params) {
439
388
  if (normalizeUserId(params.userId) === normalizeUserId(params.currentRequesterId) && resolveConversationPath(params.to).kind === "chat") return { user: {
440
389
  id: params.currentRequesterId ?? void 0,
@@ -449,11 +398,26 @@ async function getMemberInfoMSTeams(params) {
449
398
  cfg: params.cfg,
450
399
  accountId: params.accountId
451
400
  }));
452
- const member = conversation.kind === "channel" ? await findStandardChannelMember({
453
- token: await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId }),
454
- conversation,
455
- userId: params.userId
456
- }) : void 0;
401
+ let member;
402
+ if (conversation.kind === "channel") {
403
+ const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId });
404
+ if (conversation.teamId) {
405
+ if ((await require_resolve_allowlist.fetchGraphJson({
406
+ token,
407
+ path: `${conversation.basePath}?$select=membershipType`
408
+ })).membershipType !== "standard") throw new Error("Microsoft Teams member-info requires a standard channel when using the configured permission baseline.");
409
+ const requestedUserId = normalizeUserId(params.userId);
410
+ const result = await require_resolve_allowlist.fetchAllGraphPages({
411
+ token,
412
+ path: `/teams/${encodeURIComponent(conversation.teamId)}/members`,
413
+ maxPages: MAX_TEAM_MEMBER_PAGES,
414
+ collectItems: false,
415
+ findOne: (candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId
416
+ });
417
+ if (result.truncated) throw new Error("Microsoft Teams team member pagination limit exceeded");
418
+ member = result.found;
419
+ }
420
+ }
457
421
  if (!member?.userId) throw new Error(`User ${params.userId} is not a member of this conversation`);
458
422
  return { user: {
459
423
  id: member.userId,
@@ -530,15 +494,12 @@ async function sendWithDeliveryResults(send, onDeliveryResult, acceptedResults =
530
494
  const partial = (0, openclaw_plugin_sdk_channel_inbound.isChannelPartialDeliveryError)(error) ? error : void 0;
531
495
  const earlierResults = partial ? acceptedResults.slice(0, acceptedBeforeSend) : acceptedResults;
532
496
  if (earlierResults.length === 0) throw error;
533
- const receipt = (0, openclaw_plugin_sdk_channel_outbound.createMessageReceiptFromOutboundResults)({ results: [...earlierResults.map((result) => (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", result)), ...partial?.deliveryResult.receipt ? [{ receipt: partial.deliveryResult.receipt }] : (partial?.deliveryResult.messageIds ?? []).map((messageId) => ({
534
- channel: "msteams",
535
- messageId
536
- }))] });
537
497
  throw (0, openclaw_plugin_sdk_channel_inbound.createChannelPartialDeliveryError)(partial?.cause ?? error, {
538
498
  ...partial?.deliveryResult,
539
- messageIds: receipt.platformMessageIds,
540
- receipt,
541
- visibleReplySent: true
499
+ ...(0, openclaw_plugin_sdk_channel_inbound.createAcceptedChannelDeliveryResult)({ results: [...earlierResults.map((result) => (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", result)), ...partial?.deliveryResult.receipt ? [{ receipt: partial.deliveryResult.receipt }] : (partial?.deliveryResult.messageIds ?? []).map((messageId) => ({
500
+ channel: "msteams",
501
+ messageId
502
+ }))] })
542
503
  });
543
504
  }
544
505
  }
@@ -582,7 +543,7 @@ const msteamsOutbound = {
582
543
  ...require_channel.msteamsOutboundConfig,
583
544
  renderPresentation: ({ payload, presentation }) => {
584
545
  if (payload.mediaUrl || payload.mediaUrls?.length) return null;
585
- const card = require_channel.buildMSTeamsPresentationCard({
546
+ const card = require_presentation.buildMSTeamsPresentationCard({
586
547
  presentation,
587
548
  text: payload.text
588
549
  });
@@ -683,8 +644,7 @@ const msteamsOutbound = {
683
644
  maxSelections,
684
645
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
685
646
  conversationId: result.conversationId,
686
- messageId: result.messageId,
687
- votes: {}
647
+ messageId: result.messageId
688
648
  });
689
649
  return result;
690
650
  }
@@ -695,10 +655,8 @@ const msteamsOutbound = {
695
655
  function decodeJwtPayload(token) {
696
656
  const parts = token.split(".");
697
657
  if (parts.length < 2) return null;
698
- const payload = parts[1] ?? "";
699
- const normalized = payload.padEnd(payload.length + (4 - payload.length % 4) % 4, "=").replace(/-/g, "+").replace(/_/g, "/");
700
658
  try {
701
- const decoded = Buffer.from(normalized, "base64").toString("utf8");
659
+ const decoded = Buffer.from(parts[1] ?? "", "base64url").toString("utf8");
702
660
  const parsed = JSON.parse(decoded);
703
661
  return parsed && typeof parsed === "object" ? parsed : null;
704
662
  } catch {
@@ -804,7 +762,7 @@ const msTeamsChannelRuntime = {
804
762
  unreactMessageMSTeams,
805
763
  listMSTeamsDirectoryGroupsLive,
806
764
  listMSTeamsDirectoryPeersLive,
807
- msteamsOutbound: { ...msteamsOutbound },
765
+ msteamsOutbound,
808
766
  probeMSTeams,
809
767
  sendAdaptiveCardMSTeams: require_send.sendAdaptiveCardMSTeams,
810
768
  sendMessageMSTeams: require_send.sendMessageMSTeams