@openclaw/msteams 2026.10.10 → 2026.11.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{adapter.runtime-BMvpm7sS.cjs → adapter.runtime-UOD_H_ph.cjs} +20 -23
- package/dist/.setup/{approval-card-Bo8kHYbj.cjs → approval-card-CD5q0Nla.cjs} +5 -9
- package/dist/.setup/{approval-handler.runtime-BS3avHFu.cjs → approval-handler.runtime-DbPxvynk.cjs} +4 -4
- package/dist/.setup/{channel-CdCSk3Rg.cjs → channel-DQrXOfhf.cjs} +24 -224
- package/dist/.setup/{channel.runtime--ZjTYgkY.cjs → channel.runtime-Du4GPMES.cjs} +65 -106
- package/dist/.setup/{channel.setup-nSTtK77J.cjs → channel.setup--7ko_Kxv.cjs} +161 -262
- package/dist/.setup/{config-schema-Bm15lF-j.cjs → config-schema-BEXDIOC-.cjs} +120 -123
- package/dist/.setup/{conversation-store-state-NJU9osd-.cjs → conversation-store-state-AVgRyNE9.cjs} +411 -598
- package/dist/.setup/{delegated-state-CbMd3rIh.cjs → delegated-state-DhIHahf1.cjs} +68 -6
- package/dist/.setup/{monitor-BxLDs5fk.cjs → monitor-CXjIKz7o.cjs} +1883 -2284
- package/dist/.setup/{oauth-B-Y5pNM4.cjs → oauth-BWG6qWCd.cjs} +10 -20
- package/dist/.setup/presentation-CaLawc5j.cjs +211 -0
- package/dist/.setup/{reaction-types-BaL1EVBS.cjs → reaction-types-DOzN5oTl.cjs} +1 -1
- package/dist/.setup/{resolve-allowlist-CqNzS9bZ.cjs → resolve-allowlist-Drj1jaq0.cjs} +213 -90
- package/dist/.setup/{secret-contract-api-BOzdWSn9.cjs → secret-contract-api-DFqDvc_a.cjs} +4 -6
- package/dist/.setup/{secret-contract-api-5aH1Fl_c.cjs → secret-contract-api-YGHrfAT0.cjs} +1 -1
- package/dist/.setup/{send-BXjI3ufq.cjs → send-BRUztzVJ.cjs} +86 -182
- package/dist/.setup/{setup-plugin-api-lPpin6Gg.cjs → setup-plugin-api-BHEfter5.cjs} +1 -1
- package/dist/.setup/{thread-session-DZMoCsSR.cjs → thread-session-BUUV1zk_.cjs} +4 -6
- package/dist/.setup/{token-config-DTZ00Ibq.cjs → token-config-7K6UbNCo.cjs} +0 -2
- package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -1
- package/dist/api.cjs +2 -2
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +6 -13
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/secret-contract-api.cjs +1 -1
- package/dist/setup-entry.cjs +2 -2
- package/dist/setup-plugin-api.cjs +1 -1
- package/openclaw.plugin.json +0 -30
- package/package.json +11 -11
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
const require_token_config = require("./token-config-
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_token_config = require("./token-config-7K6UbNCo.cjs");
|
|
2
|
+
const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.cjs");
|
|
3
3
|
require("../runtime-api.cjs");
|
|
4
|
-
const require_delegated_state = require("./delegated-state-
|
|
5
|
-
const require_channel = require("./channel-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
const require_delegated_state = require("./delegated-state-DhIHahf1.cjs");
|
|
5
|
+
const require_channel = require("./channel-DQrXOfhf.cjs");
|
|
6
|
+
const require_presentation = require("./presentation-CaLawc5j.cjs");
|
|
7
|
+
const require_channel_setup = require("./channel.setup--7ko_Kxv.cjs");
|
|
8
|
+
const require_conversation_store_state = require("./conversation-store-state-AVgRyNE9.cjs");
|
|
9
|
+
const require_send = require("./send-BRUztzVJ.cjs");
|
|
10
|
+
const require_reaction_types = require("./reaction-types-DOzN5oTl.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
|
// extensions/msteams/src/directory-live.ts
|
|
20
21
|
async function listMSTeamsDirectoryPeersLive(params) {
|
|
21
|
-
const 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 =
|
|
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 =
|
|
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 =
|
|
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.
|
|
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.
|
|
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;
|
|
@@ -111,14 +112,12 @@ function resolveConversationPath(to) {
|
|
|
111
112
|
return {
|
|
112
113
|
kind: "channel",
|
|
113
114
|
basePath: `/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}`,
|
|
114
|
-
teamId
|
|
115
|
-
channelId
|
|
115
|
+
teamId
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
return {
|
|
119
119
|
kind: "chat",
|
|
120
|
-
basePath: `/chats/${encodeURIComponent(cleaned)}
|
|
121
|
-
chatId: cleaned
|
|
120
|
+
basePath: `/chats/${encodeURIComponent(cleaned)}`
|
|
122
121
|
};
|
|
123
122
|
}
|
|
124
123
|
async function resolveGraphMessageContext(params, options) {
|
|
@@ -184,29 +183,17 @@ async function unpinMessageMSTeams(params) {
|
|
|
184
183
|
const LIST_PINS_MAX_PAGES = 10;
|
|
185
184
|
async function listPinsMSTeams(params) {
|
|
186
185
|
const { token, basePath } = await resolveGraphPinContext(params, "list");
|
|
187
|
-
const
|
|
188
|
-
const allPins = [];
|
|
189
|
-
let res = await require_resolve_allowlist.fetchGraphJson({
|
|
186
|
+
const { items } = await require_resolve_allowlist.fetchAllGraphPages({
|
|
190
187
|
token,
|
|
191
|
-
path
|
|
188
|
+
path: `${basePath}/pinnedMessages?$expand=message`,
|
|
189
|
+
maxPages: LIST_PINS_MAX_PAGES
|
|
192
190
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
text: pin.message?.body?.content
|
|
200
|
-
});
|
|
201
|
-
const nextLink = res["@odata.nextLink"];
|
|
202
|
-
if (!nextLink || pages >= LIST_PINS_MAX_PAGES) break;
|
|
203
|
-
res = await require_resolve_allowlist.fetchGraphAbsoluteUrl({
|
|
204
|
-
token,
|
|
205
|
-
url: nextLink
|
|
206
|
-
});
|
|
207
|
-
pages++;
|
|
208
|
-
}
|
|
209
|
-
return { pins: allPins };
|
|
191
|
+
return { pins: items.map((pin) => ({
|
|
192
|
+
id: pin.id ?? "",
|
|
193
|
+
pinnedMessageId: pin.id ?? "",
|
|
194
|
+
messageId: pin.message?.id,
|
|
195
|
+
text: pin.message?.body?.content
|
|
196
|
+
})) };
|
|
210
197
|
}
|
|
211
198
|
async function mutateMessageReaction(params, operation) {
|
|
212
199
|
const reactionType = require_reaction_types.resolveMSTeamsReactionEmoji(params.reactionType);
|
|
@@ -323,29 +310,8 @@ async function searchMessagesMSTeams(params) {
|
|
|
323
310
|
truncated
|
|
324
311
|
};
|
|
325
312
|
}
|
|
326
|
-
// extensions/msteams/src/graph-conversation-members.ts
|
|
327
|
-
const MAX_CONVERSATION_MEMBER_PAGES = 100;
|
|
328
|
-
async function findMSTeamsConversationMember(params) {
|
|
329
|
-
const conversationId = await resolveGraphConversationId(params.to, {
|
|
330
|
-
cfg: params.cfg,
|
|
331
|
-
accountId: params.accountId
|
|
332
|
-
});
|
|
333
|
-
const conversation = resolveConversationPath(conversationId);
|
|
334
|
-
const userId = params.userId.trim().toLowerCase();
|
|
335
|
-
const result = await require_resolve_allowlist.fetchAllGraphPages({
|
|
336
|
-
token: params.token,
|
|
337
|
-
path: `${conversation.basePath}/members`,
|
|
338
|
-
maxPages: MAX_CONVERSATION_MEMBER_PAGES,
|
|
339
|
-
collectItems: false,
|
|
340
|
-
findOne: (candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId
|
|
341
|
-
});
|
|
342
|
-
if (result.truncated) throw new Error("MS Teams conversation member pagination limit exceeded");
|
|
343
|
-
return {
|
|
344
|
-
conversationId,
|
|
345
|
-
member: result.found
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
313
|
// extensions/msteams/src/graph-group-management.ts
|
|
314
|
+
const MAX_CONVERSATION_MEMBER_PAGES = 100;
|
|
349
315
|
function resolveConversationMemberRoles(role, kind) {
|
|
350
316
|
const normalized = role?.trim().toLowerCase() || "member";
|
|
351
317
|
if (normalized !== "member" && normalized !== "owner") throw new Error("MS Teams participant role must be \"member\" or \"owner\".");
|
|
@@ -375,19 +341,21 @@ async function addParticipantMSTeams(params) {
|
|
|
375
341
|
* Lists members first to resolve the membership ID, then deletes.
|
|
376
342
|
*/
|
|
377
343
|
async function removeParticipantMSTeams(params) {
|
|
378
|
-
const token = await
|
|
379
|
-
const
|
|
344
|
+
const { token, conversationId, basePath } = await resolveGraphMessageContext(params);
|
|
345
|
+
const userId = params.userId.trim().toLowerCase();
|
|
346
|
+
const result = await require_resolve_allowlist.fetchAllGraphPages({
|
|
380
347
|
token,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
348
|
+
path: `${basePath}/members`,
|
|
349
|
+
maxPages: MAX_CONVERSATION_MEMBER_PAGES,
|
|
350
|
+
collectItems: false,
|
|
351
|
+
findOne: (candidate) => candidate.userId?.trim().toLowerCase() === userId || candidate.email?.trim().toLowerCase() === userId
|
|
385
352
|
});
|
|
353
|
+
if (result.truncated) throw new Error("MS Teams conversation member pagination limit exceeded");
|
|
354
|
+
const member = result.found;
|
|
386
355
|
if (!member?.id) throw new Error(`User ${params.userId} is not a member of this conversation`);
|
|
387
|
-
const conv = resolveConversationPath(conversationId);
|
|
388
356
|
await require_resolve_allowlist.deleteGraphRequest({
|
|
389
357
|
token,
|
|
390
|
-
path: `${
|
|
358
|
+
path: `${basePath}/members/${encodeURIComponent(member.id)}`
|
|
391
359
|
});
|
|
392
360
|
return { removed: {
|
|
393
361
|
userId: params.userId,
|
|
@@ -413,24 +381,6 @@ const MAX_TEAM_MEMBER_PAGES = 100;
|
|
|
413
381
|
function normalizeUserId(value) {
|
|
414
382
|
return value?.replace(/^(msteams|teams|user):/i, "").trim().toLowerCase() ?? "";
|
|
415
383
|
}
|
|
416
|
-
async function findStandardChannelMember(params) {
|
|
417
|
-
const { conversation } = params;
|
|
418
|
-
if (conversation.kind !== "channel" || !conversation.teamId) return;
|
|
419
|
-
if ((await require_resolve_allowlist.fetchGraphJson({
|
|
420
|
-
token: params.token,
|
|
421
|
-
path: `${conversation.basePath}?$select=membershipType`
|
|
422
|
-
})).membershipType !== "standard") throw new Error("Microsoft Teams member-info requires a standard channel when using the configured permission baseline.");
|
|
423
|
-
const requestedUserId = normalizeUserId(params.userId);
|
|
424
|
-
const result = await require_resolve_allowlist.fetchAllGraphPages({
|
|
425
|
-
token: params.token,
|
|
426
|
-
path: `/teams/${encodeURIComponent(conversation.teamId)}/members`,
|
|
427
|
-
maxPages: MAX_TEAM_MEMBER_PAGES,
|
|
428
|
-
collectItems: false,
|
|
429
|
-
findOne: (candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId
|
|
430
|
-
});
|
|
431
|
-
if (result.truncated) throw new Error("Microsoft Teams team member pagination limit exceeded");
|
|
432
|
-
return result.found;
|
|
433
|
-
}
|
|
434
384
|
async function getMemberInfoMSTeams(params) {
|
|
435
385
|
if (normalizeUserId(params.userId) === normalizeUserId(params.currentRequesterId) && resolveConversationPath(params.to).kind === "chat") return { user: {
|
|
436
386
|
id: params.currentRequesterId ?? void 0,
|
|
@@ -445,11 +395,26 @@ async function getMemberInfoMSTeams(params) {
|
|
|
445
395
|
cfg: params.cfg,
|
|
446
396
|
accountId: params.accountId
|
|
447
397
|
}));
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
398
|
+
let member;
|
|
399
|
+
if (conversation.kind === "channel") {
|
|
400
|
+
const token = await require_resolve_allowlist.resolveGraphToken(params.cfg, { accountId: params.accountId });
|
|
401
|
+
if (conversation.teamId) {
|
|
402
|
+
if ((await require_resolve_allowlist.fetchGraphJson({
|
|
403
|
+
token,
|
|
404
|
+
path: `${conversation.basePath}?$select=membershipType`
|
|
405
|
+
})).membershipType !== "standard") throw new Error("Microsoft Teams member-info requires a standard channel when using the configured permission baseline.");
|
|
406
|
+
const requestedUserId = normalizeUserId(params.userId);
|
|
407
|
+
const result = await require_resolve_allowlist.fetchAllGraphPages({
|
|
408
|
+
token,
|
|
409
|
+
path: `/teams/${encodeURIComponent(conversation.teamId)}/members`,
|
|
410
|
+
maxPages: MAX_TEAM_MEMBER_PAGES,
|
|
411
|
+
collectItems: false,
|
|
412
|
+
findOne: (candidate) => normalizeUserId(candidate.userId) === requestedUserId || normalizeUserId(candidate.email) === requestedUserId
|
|
413
|
+
});
|
|
414
|
+
if (result.truncated) throw new Error("Microsoft Teams team member pagination limit exceeded");
|
|
415
|
+
member = result.found;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
453
418
|
if (!member?.userId) throw new Error(`User ${params.userId} is not a member of this conversation`);
|
|
454
419
|
return { user: {
|
|
455
420
|
id: member.userId,
|
|
@@ -524,15 +489,12 @@ async function sendWithDeliveryResults(send, onDeliveryResult, acceptedResults =
|
|
|
524
489
|
const partial = (0, openclaw_plugin_sdk_channel_inbound.isChannelPartialDeliveryError)(error) ? error : void 0;
|
|
525
490
|
const earlierResults = partial ? acceptedResults.slice(0, acceptedBeforeSend) : acceptedResults;
|
|
526
491
|
if (earlierResults.length === 0) throw error;
|
|
527
|
-
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) => ({
|
|
528
|
-
channel: "msteams",
|
|
529
|
-
messageId
|
|
530
|
-
}))] });
|
|
531
492
|
throw (0, openclaw_plugin_sdk_channel_inbound.createChannelPartialDeliveryError)(partial?.cause ?? error, {
|
|
532
493
|
...partial?.deliveryResult,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
494
|
+
...(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) => ({
|
|
495
|
+
channel: "msteams",
|
|
496
|
+
messageId
|
|
497
|
+
}))] })
|
|
536
498
|
});
|
|
537
499
|
}
|
|
538
500
|
}
|
|
@@ -576,7 +538,7 @@ const msteamsOutbound = {
|
|
|
576
538
|
...require_channel.msteamsOutboundConfig,
|
|
577
539
|
renderPresentation: ({ payload, presentation }) => {
|
|
578
540
|
if (payload.mediaUrl || payload.mediaUrls?.length) return null;
|
|
579
|
-
const card =
|
|
541
|
+
const card = require_presentation.buildMSTeamsPresentationCard({
|
|
580
542
|
presentation,
|
|
581
543
|
text: payload.text
|
|
582
544
|
});
|
|
@@ -677,8 +639,7 @@ const msteamsOutbound = {
|
|
|
677
639
|
maxSelections,
|
|
678
640
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
679
641
|
conversationId: result.conversationId,
|
|
680
|
-
messageId: result.messageId
|
|
681
|
-
votes: {}
|
|
642
|
+
messageId: result.messageId
|
|
682
643
|
});
|
|
683
644
|
return result;
|
|
684
645
|
}
|
|
@@ -688,10 +649,8 @@ const msteamsOutbound = {
|
|
|
688
649
|
function decodeJwtPayload(token) {
|
|
689
650
|
const parts = token.split(".");
|
|
690
651
|
if (parts.length < 2) return null;
|
|
691
|
-
const payload = parts[1] ?? "";
|
|
692
|
-
const normalized = payload.padEnd(payload.length + (4 - payload.length % 4) % 4, "=").replace(/-/g, "+").replace(/_/g, "/");
|
|
693
652
|
try {
|
|
694
|
-
const decoded = Buffer.from(
|
|
653
|
+
const decoded = Buffer.from(parts[1] ?? "", "base64url").toString("utf8");
|
|
695
654
|
const parsed = JSON.parse(decoded);
|
|
696
655
|
return parsed && typeof parsed === "object" ? parsed : null;
|
|
697
656
|
} catch {
|
|
@@ -796,7 +755,7 @@ const msTeamsChannelRuntime = {
|
|
|
796
755
|
unreactMessageMSTeams,
|
|
797
756
|
listMSTeamsDirectoryGroupsLive,
|
|
798
757
|
listMSTeamsDirectoryPeersLive,
|
|
799
|
-
msteamsOutbound
|
|
758
|
+
msteamsOutbound,
|
|
800
759
|
probeMSTeams,
|
|
801
760
|
sendAdaptiveCardMSTeams: require_send.sendAdaptiveCardMSTeams,
|
|
802
761
|
sendMessageMSTeams: require_send.sendMessageMSTeams
|