@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.
- package/dist/{adapter.runtime-8g-MOPfb.cjs → adapter.runtime-DDuc7sKJ.cjs} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/{approval-card-B6ZIMO83.cjs → approval-card-ClrTjCsL.cjs} +15 -5
- package/dist/{approval-handler.runtime-C3FXQ_6Z.cjs → approval-handler.runtime-9rMFhyLp.cjs} +9 -5
- package/dist/{channel-BsqcQ0E9.cjs → channel-CqRcu6kk.cjs} +22 -14
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/{channel.runtime-DuQWuKFd.cjs → channel.runtime-BAy59d1L.cjs} +64 -69
- package/dist/{channel.setup-BvYxZIFG.cjs → channel.setup-D2YO3F4O.cjs} +22 -18
- package/dist/{config-schema-C4CszdDi.cjs → config-schema-MyN2lamA.cjs} +12 -11
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +79 -42
- package/dist/{messenger-BJB30CC2.cjs → messenger-BvR2flEt.cjs} +23 -17
- package/dist/{oauth-BXQBTEta.cjs → oauth-BeROaYf0.cjs} +4 -3
- package/dist/{polls-DvuJvaDG.cjs → polls-P86qBpeV.cjs} +5 -4
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/{reaction-types-dGkp4bkW.cjs → reaction-types-DcJBoyFP.cjs} +3 -2
- package/dist/{resolve-allowlist-B6FQAa3r.cjs → resolve-allowlist-CoKmLXYe.cjs} +37 -62
- package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
- package/dist/runtime-api.cjs +2 -1
- package/dist/{send-S0VPVSUi.cjs → send-CAKTR80N.cjs} +18 -14
- package/dist/setup-plugin-api.cjs +1 -1
- package/dist/{src-NMnaP_95.cjs → src-CyNCea9B.cjs} +124 -94
- package/dist/{sso-token-store-ChhO1f4i.cjs → sso-token-store-CNbRhz-A.cjs} +1 -1
- package/dist/{thread-session-DdWfgc8U.cjs → thread-session-p8FNgohv.cjs} +1 -1
- package/package.json +6 -6
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
2
2
|
require("./runtime-api.cjs");
|
|
3
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
4
|
-
const require_channel = require("./channel-
|
|
5
|
-
const require_channel_setup = require("./channel.setup-
|
|
6
|
-
const require_polls = require("./polls-
|
|
7
|
-
const require_messenger = require("./messenger-
|
|
3
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
|
|
4
|
+
const require_channel = require("./channel-CqRcu6kk.cjs");
|
|
5
|
+
const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
|
|
6
|
+
const require_polls = require("./polls-P86qBpeV.cjs");
|
|
7
|
+
const require_messenger = require("./messenger-BvR2flEt.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_markdown_table_runtime = require("openclaw/plugin-sdk/markdown-table-runtime");
|
|
11
|
-
let
|
|
11
|
+
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
12
12
|
let openclaw_plugin_sdk_outbound_media = require("openclaw/plugin-sdk/outbound-media");
|
|
13
13
|
//#region extensions/msteams/src/send-context.ts
|
|
14
14
|
function resolveMSTeamsProactiveReplyTarget(params) {
|
|
@@ -148,7 +148,7 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
148
148
|
conversationType
|
|
149
149
|
});
|
|
150
150
|
const sharePointSiteId = msteamsCfg.sharePointSiteId;
|
|
151
|
-
const mediaMaxBytes = (0,
|
|
151
|
+
const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
|
|
152
152
|
cfg: params.cfg,
|
|
153
153
|
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
|
|
154
154
|
});
|
|
@@ -169,12 +169,12 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
169
169
|
//#endregion
|
|
170
170
|
//#region extensions/msteams/src/send.ts
|
|
171
171
|
/** Threshold for large files that require FileConsentCard flow in personal chats */
|
|
172
|
-
const FILE_CONSENT_THRESHOLD_BYTES =
|
|
172
|
+
const FILE_CONSENT_THRESHOLD_BYTES = 4194304;
|
|
173
173
|
/**
|
|
174
174
|
* MSTeams-specific media size limit (100MB).
|
|
175
175
|
* Higher than the default to support Teams file-consent and SharePoint uploads.
|
|
176
176
|
*/
|
|
177
|
-
const MSTEAMS_MAX_MEDIA_BYTES =
|
|
177
|
+
const MSTEAMS_MAX_MEDIA_BYTES = 104857600;
|
|
178
178
|
function createMSTeamsSendError(errorPrefix, error) {
|
|
179
179
|
const classification = require_channel_setup.classifyMSTeamsSendError(error);
|
|
180
180
|
const hint = require_channel_setup.formatMSTeamsSendErrorHint(classification);
|
|
@@ -250,8 +250,9 @@ async function sendMessageMSTeams(params) {
|
|
|
250
250
|
hasMedia: Boolean(mediaUrl)
|
|
251
251
|
});
|
|
252
252
|
if (mediaUrl) {
|
|
253
|
+
const mediaMaxBytes = ctx.mediaMaxBytes ?? MSTEAMS_MAX_MEDIA_BYTES;
|
|
253
254
|
const media = await (0, openclaw_plugin_sdk_outbound_media.loadOutboundMediaFromUrl)(mediaUrl, {
|
|
254
|
-
maxBytes:
|
|
255
|
+
maxBytes: mediaMaxBytes,
|
|
255
256
|
mediaAccess,
|
|
256
257
|
mediaLocalRoots,
|
|
257
258
|
mediaReadFile
|
|
@@ -419,10 +420,11 @@ async function sendTextWithMedia(ctx, text, mediaUrl) {
|
|
|
419
420
|
}
|
|
420
421
|
async function sendProactiveActivityRaw({ ctx, activity }) {
|
|
421
422
|
const baseRef = require_messenger.buildConversationReference(ctx.ref);
|
|
422
|
-
|
|
423
|
+
const response = await require_messenger.sendMSTeamsActivityWithReference(ctx.app, baseRef, activity, {
|
|
423
424
|
...ctx.threadActivityId ? { threadActivityId: ctx.threadActivityId } : {},
|
|
424
425
|
serviceUrlBoundary: ctx.sdkCloudOptions
|
|
425
|
-
})
|
|
426
|
+
});
|
|
427
|
+
return require_messenger.extractMessageId(response) ?? "unknown";
|
|
426
428
|
}
|
|
427
429
|
async function sendProactiveActivity({ ctx, activity, errorPrefix }) {
|
|
428
430
|
try {
|
|
@@ -551,7 +553,8 @@ async function updateMSTeamsMessageActivity(params) {
|
|
|
551
553
|
activityId
|
|
552
554
|
});
|
|
553
555
|
try {
|
|
554
|
-
|
|
556
|
+
const baseRef = require_messenger.buildConversationReference(ref);
|
|
557
|
+
await require_messenger.updateMSTeamsActivityWithReference(app, baseRef, activityId, activity, { serviceUrlBoundary: sdkCloudOptions });
|
|
555
558
|
} catch (err) {
|
|
556
559
|
throw createMSTeamsSendError("msteams edit", err);
|
|
557
560
|
}
|
|
@@ -578,7 +581,8 @@ async function deleteMessageMSTeams(params) {
|
|
|
578
581
|
activityId
|
|
579
582
|
});
|
|
580
583
|
try {
|
|
581
|
-
|
|
584
|
+
const baseRef = require_messenger.buildConversationReference(ref);
|
|
585
|
+
await require_messenger.deleteMSTeamsActivityWithReference(app, baseRef, activityId, { serviceUrlBoundary: sdkCloudOptions });
|
|
582
586
|
} catch (err) {
|
|
583
587
|
throw createMSTeamsSendError("msteams delete", err);
|
|
584
588
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_channel_setup = require("./channel.setup-
|
|
2
|
+
const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
|
|
3
3
|
exports.msteamsSetupPlugin = require_channel_setup.msteamsSetupPlugin;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
|
|
2
2
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
3
3
|
require("./runtime-api.cjs");
|
|
4
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
5
|
-
const require_channel = require("./channel-
|
|
6
|
-
const require_thread_session = require("./thread-session-
|
|
7
|
-
const require_channel_setup = require("./channel.setup-
|
|
8
|
-
const require_polls = require("./polls-
|
|
9
|
-
const require_sso_token_store = require("./sso-token-store-
|
|
10
|
-
const require_approval_card = require("./approval-card-
|
|
11
|
-
const require_messenger = require("./messenger-
|
|
12
|
-
const require_reaction_types = require("./reaction-types-
|
|
4
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
|
|
5
|
+
const require_channel = require("./channel-CqRcu6kk.cjs");
|
|
6
|
+
const require_thread_session = require("./thread-session-p8FNgohv.cjs");
|
|
7
|
+
const require_channel_setup = require("./channel.setup-D2YO3F4O.cjs");
|
|
8
|
+
const require_polls = require("./polls-P86qBpeV.cjs");
|
|
9
|
+
const require_sso_token_store = require("./sso-token-store-CNbRhz-A.cjs");
|
|
10
|
+
const require_approval_card = require("./approval-card-ClrTjCsL.cjs");
|
|
11
|
+
const require_messenger = require("./messenger-BvR2flEt.cjs");
|
|
12
|
+
const require_reaction_types = require("./reaction-types-DcJBoyFP.cjs");
|
|
13
13
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
14
14
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
15
15
|
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
@@ -38,6 +38,7 @@ let openclaw_plugin_sdk_gateway_runtime = require("openclaw/plugin-sdk/gateway-r
|
|
|
38
38
|
let openclaw_plugin_sdk_channel_pairing = require("openclaw/plugin-sdk/channel-pairing");
|
|
39
39
|
let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
|
|
40
40
|
let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
|
|
41
|
+
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
41
42
|
let openclaw_plugin_sdk_webhook_ingress = require("openclaw/plugin-sdk/webhook-ingress");
|
|
42
43
|
//#region extensions/msteams/src/feedback-reflection-store.ts
|
|
43
44
|
const LEARNINGS_NAMESPACE = "feedback-learnings";
|
|
@@ -266,16 +267,18 @@ async function maybeHandleMSTeamsApprovalCardSubmit(params) {
|
|
|
266
267
|
//#region extensions/msteams/src/monitor-handler/access.ts
|
|
267
268
|
const msteamsIngressIdentity = {
|
|
268
269
|
key: "sender-id",
|
|
270
|
+
authentication: "asserted",
|
|
269
271
|
normalize: normalizeIngressValue,
|
|
270
272
|
aliases: [{
|
|
271
273
|
key: "sender-name",
|
|
272
274
|
kind: "plugin:msteams-sender-name",
|
|
273
275
|
normalizeEntry: normalizeSenderNameIngressValue,
|
|
274
276
|
normalizeSubject: normalizeSenderNameIngressValue,
|
|
275
|
-
|
|
277
|
+
authentication: "mutable"
|
|
276
278
|
}, {
|
|
277
279
|
key: "conversation-id",
|
|
278
280
|
kind: "plugin:msteams-conversation-id",
|
|
281
|
+
authentication: "asserted",
|
|
279
282
|
normalizeEntry: normalizeAllowlistConversationId,
|
|
280
283
|
normalizeSubject: normalizeAllowlistConversationId
|
|
281
284
|
}],
|
|
@@ -318,8 +321,9 @@ async function resolveMSTeamsSenderAccess(params) {
|
|
|
318
321
|
const isDirectMessage = convType === "personal" || !convType && !activity.conversation?.isGroup;
|
|
319
322
|
const senderId = activity.from?.aadObjectId ?? activity.from?.id ?? "unknown";
|
|
320
323
|
const senderName = activity.from?.name ?? activity.from?.id ?? senderId;
|
|
324
|
+
const core = require_runtime.getMSTeamsRuntime();
|
|
321
325
|
const pairing = (0, openclaw_plugin_sdk_channel_pairing.createChannelPairingController)({
|
|
322
|
-
core
|
|
326
|
+
core,
|
|
323
327
|
channel: "msteams",
|
|
324
328
|
accountId: openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID
|
|
325
329
|
});
|
|
@@ -340,7 +344,23 @@ async function resolveMSTeamsSenderAccess(params) {
|
|
|
340
344
|
const resolved = await (0, openclaw_plugin_sdk_channel_ingress_runtime.resolveStableChannelMessageIngress)({
|
|
341
345
|
channelId: "msteams",
|
|
342
346
|
accountId: pairing.accountId,
|
|
343
|
-
identity:
|
|
347
|
+
identity: {
|
|
348
|
+
...msteamsIngressIdentity,
|
|
349
|
+
resolveParticipant: () => {
|
|
350
|
+
const tenantId = activity.channelData?.tenant?.id ?? activity.conversation?.tenantId;
|
|
351
|
+
const aadId = activity.from?.aadObjectId;
|
|
352
|
+
if (tenantId && aadId) return {
|
|
353
|
+
domain: `entra:${tenantId.toLowerCase()}`,
|
|
354
|
+
idKind: "object-id",
|
|
355
|
+
id: aadId.toLowerCase()
|
|
356
|
+
};
|
|
357
|
+
return msteamsCfg?.appId && activity.from?.id ? {
|
|
358
|
+
domain: `bot:${msteamsCfg.appId.toLowerCase()}`,
|
|
359
|
+
idKind: "channel-account-id",
|
|
360
|
+
id: activity.from.id
|
|
361
|
+
} : void 0;
|
|
362
|
+
}
|
|
363
|
+
},
|
|
344
364
|
cfg: params.cfg,
|
|
345
365
|
readStoreAllowFrom: pairing.readAllowFromStore,
|
|
346
366
|
subject: {
|
|
@@ -658,7 +678,8 @@ async function downloadMSTeamsBotFrameworkAttachment(params) {
|
|
|
658
678
|
allowHosts: params.allowHosts,
|
|
659
679
|
authAllowHosts: params.authAllowHosts
|
|
660
680
|
});
|
|
661
|
-
|
|
681
|
+
const baseUrl = `${normalizeServiceUrl(params.serviceUrl)}/v3/attachments/${encodeURIComponent(params.attachmentId)}`;
|
|
682
|
+
if (!require_resolve_allowlist.isUrlAllowed(baseUrl, policy.allowHosts)) return;
|
|
662
683
|
let accessToken;
|
|
663
684
|
try {
|
|
664
685
|
accessToken = await require_resolve_allowlist.withMSTeamsRequestDeadline({
|
|
@@ -820,9 +841,11 @@ function summarizeMSTeamsHtmlAttachments(attachments) {
|
|
|
820
841
|
while (match) {
|
|
821
842
|
imgTags += 1;
|
|
822
843
|
const src = match[1]?.trim();
|
|
823
|
-
if (src)
|
|
824
|
-
|
|
825
|
-
|
|
844
|
+
if (src) {
|
|
845
|
+
if (src.startsWith("data:")) dataImages += 1;
|
|
846
|
+
else if (src.startsWith("cid:")) cidImages += 1;
|
|
847
|
+
else srcHosts.add(require_resolve_allowlist.safeHostForUrl(src));
|
|
848
|
+
}
|
|
826
849
|
match = require_resolve_allowlist.IMG_SRC_RE.exec(html);
|
|
827
850
|
}
|
|
828
851
|
require_resolve_allowlist.ATTACHMENT_TAG_RE.lastIndex = 0;
|
|
@@ -982,10 +1005,11 @@ function scopeCandidatesForUrl(url) {
|
|
|
982
1005
|
}
|
|
983
1006
|
}
|
|
984
1007
|
async function resolveInlineDataImageMime(inline) {
|
|
985
|
-
const
|
|
1008
|
+
const detectedMime = await require_runtime.getMSTeamsRuntime().media.detectMime({
|
|
986
1009
|
buffer: inline.data,
|
|
987
1010
|
headerMime: inline.contentType
|
|
988
|
-
})
|
|
1011
|
+
});
|
|
1012
|
+
const mime = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalLowercaseString)(detectedMime ?? inline.contentType);
|
|
989
1013
|
return mime?.startsWith("image/") ? mime : void 0;
|
|
990
1014
|
}
|
|
991
1015
|
async function fetchWithAuthFallback(params) {
|
|
@@ -1576,26 +1600,28 @@ async function resolveMSTeamsInboundMedia(params) {
|
|
|
1576
1600
|
});
|
|
1577
1601
|
const shouldFetchGraphMessage = hasHtmlFileAttachment || hasChannelOrGroupHtml;
|
|
1578
1602
|
const isBotFrameworkPersonalChat = isBotFrameworkPersonalChatId(conversationId);
|
|
1579
|
-
if (hasHtmlFileAttachment && isBotFrameworkPersonalChat)
|
|
1580
|
-
|
|
1581
|
-
conversationId
|
|
1582
|
-
});
|
|
1583
|
-
else {
|
|
1584
|
-
const bfMedia = await downloadMSTeamsBotFrameworkAttachments({
|
|
1585
|
-
serviceUrl,
|
|
1586
|
-
attachmentIds,
|
|
1587
|
-
tokenProvider,
|
|
1588
|
-
maxBytes,
|
|
1589
|
-
allowHosts,
|
|
1590
|
-
authAllowHosts: params.authAllowHosts,
|
|
1591
|
-
preserveFilenames,
|
|
1592
|
-
deadline: params.deadline
|
|
1593
|
-
});
|
|
1594
|
-
if (bfMedia.media.length > 0) mediaList = mergeMSTeamsMediaFacts(mediaList, bfMedia.media, { positionallyAligned: false });
|
|
1595
|
-
if (!hasMaterializedMedia(bfMedia.media)) log.debug?.("bot framework attachments fetch empty", {
|
|
1603
|
+
if (hasHtmlFileAttachment && isBotFrameworkPersonalChat) {
|
|
1604
|
+
if (!serviceUrl) log.debug?.("bot framework attachment skipped (missing serviceUrl)", {
|
|
1596
1605
|
conversationType,
|
|
1597
|
-
|
|
1606
|
+
conversationId
|
|
1598
1607
|
});
|
|
1608
|
+
else {
|
|
1609
|
+
const bfMedia = await downloadMSTeamsBotFrameworkAttachments({
|
|
1610
|
+
serviceUrl,
|
|
1611
|
+
attachmentIds,
|
|
1612
|
+
tokenProvider,
|
|
1613
|
+
maxBytes,
|
|
1614
|
+
allowHosts,
|
|
1615
|
+
authAllowHosts: params.authAllowHosts,
|
|
1616
|
+
preserveFilenames,
|
|
1617
|
+
deadline: params.deadline
|
|
1618
|
+
});
|
|
1619
|
+
if (bfMedia.media.length > 0) mediaList = mergeMSTeamsMediaFacts(mediaList, bfMedia.media, { positionallyAligned: false });
|
|
1620
|
+
if (!hasMaterializedMedia(bfMedia.media)) log.debug?.("bot framework attachments fetch empty", {
|
|
1621
|
+
conversationType,
|
|
1622
|
+
attachmentCount: bfMedia.attachmentCount ?? attachmentIds.length
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1599
1625
|
}
|
|
1600
1626
|
if (shouldFetchGraphMessage && !hasMaterializedMedia(mediaList) && !isBotFrameworkPersonalChat) {
|
|
1601
1627
|
const graphTeamAadGroupId = conversationType.trim().toLowerCase() === "channel" && !teamAadGroupId ? await params.resolveTeamAadGroupId?.() : teamAadGroupId;
|
|
@@ -2140,7 +2166,7 @@ function createMSTeamsReplyDispatcher(params) {
|
|
|
2140
2166
|
* chains described in #59731 (60s+ total runs are common). Give tool
|
|
2141
2167
|
* chains up to 10 minutes before auto-stopping the keepalive.
|
|
2142
2168
|
*/
|
|
2143
|
-
const TYPING_KEEPALIVE_MAX_DURATION_MS =
|
|
2169
|
+
const TYPING_KEEPALIVE_MAX_DURATION_MS = 6e5;
|
|
2144
2170
|
const streamActiveRef = { current: () => false };
|
|
2145
2171
|
const streamCanceledRef = { current: () => false };
|
|
2146
2172
|
const rawSendTypingIndicator = async () => {
|
|
@@ -2186,7 +2212,7 @@ function createMSTeamsReplyDispatcher(params) {
|
|
|
2186
2212
|
cfg: params.cfg,
|
|
2187
2213
|
channel: "msteams"
|
|
2188
2214
|
});
|
|
2189
|
-
const mediaMaxBytes = (0,
|
|
2215
|
+
const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
|
|
2190
2216
|
cfg: params.cfg,
|
|
2191
2217
|
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
|
|
2192
2218
|
});
|
|
@@ -2534,7 +2560,7 @@ function createMSTeamsReplyDispatcher(params) {
|
|
|
2534
2560
|
//#region extensions/msteams/src/sent-message-cache.ts
|
|
2535
2561
|
const sentMessages = (0, openclaw_plugin_sdk_dedupe_runtime.createPersistentDedupeCache)({
|
|
2536
2562
|
globalKey: Symbol.for("openclaw.msteamsSentMessages"),
|
|
2537
|
-
ttlMs:
|
|
2563
|
+
ttlMs: 864e5,
|
|
2538
2564
|
maxSize: 2e4,
|
|
2539
2565
|
persistent: {
|
|
2540
2566
|
namespace: "msteams.sent-messages",
|
|
@@ -2913,7 +2939,7 @@ async function resolveTeamGroupId(params) {
|
|
|
2913
2939
|
}
|
|
2914
2940
|
//#endregion
|
|
2915
2941
|
//#region extensions/msteams/src/thread-parent-context.ts
|
|
2916
|
-
const PARENT_CACHE_TTL_MS =
|
|
2942
|
+
const PARENT_CACHE_TTL_MS = 3e5;
|
|
2917
2943
|
const PARENT_CACHE_MAX = 100;
|
|
2918
2944
|
const parentCache = /* @__PURE__ */ new Map();
|
|
2919
2945
|
const INJECTED_MAX = 200;
|
|
@@ -2973,7 +2999,7 @@ function summarizeParentMessage(message) {
|
|
|
2973
2999
|
if (!text) return;
|
|
2974
3000
|
return {
|
|
2975
3001
|
sender,
|
|
2976
|
-
text: text.length > PARENT_TEXT_MAX_CHARS ? `${(0, openclaw_plugin_sdk_text_utility_runtime.truncateUtf16Safe)(text,
|
|
3002
|
+
text: text.length > PARENT_TEXT_MAX_CHARS ? `${(0, openclaw_plugin_sdk_text_utility_runtime.truncateUtf16Safe)(text, 399)}…` : text
|
|
2977
3003
|
};
|
|
2978
3004
|
}
|
|
2979
3005
|
/**
|
|
@@ -3041,6 +3067,7 @@ function prepareMSTeamsThreadRouting(params) {
|
|
|
3041
3067
|
};
|
|
3042
3068
|
return {
|
|
3043
3069
|
route,
|
|
3070
|
+
threadRootId: params.conversationMessageId ?? params.context.activity.replyToId,
|
|
3044
3071
|
deadline,
|
|
3045
3072
|
resolveTeamAadGroupId,
|
|
3046
3073
|
getTeamAadGroupId: () => teamAadGroupId
|
|
@@ -3070,8 +3097,8 @@ async function resolveMSTeamsThreadContext(params) {
|
|
|
3070
3097
|
params.log.debug?.("failed to fetch full quoted message text", { error: require_channel_setup.formatUnknownError(err) });
|
|
3071
3098
|
}
|
|
3072
3099
|
let threadContext;
|
|
3073
|
-
const threadParentId =
|
|
3074
|
-
if (threadParentId && params.isChannel && teamAadGroupId) try {
|
|
3100
|
+
const threadParentId = params.routing.threadRootId;
|
|
3101
|
+
if (threadParentId && threadParentId !== activity.id && params.isChannel && teamAadGroupId) try {
|
|
3075
3102
|
const graphToken = await require_resolve_allowlist.withMSTeamsRequestDeadline({
|
|
3076
3103
|
deadline,
|
|
3077
3104
|
label: "MS Teams thread token",
|
|
@@ -3413,7 +3440,8 @@ function createMSTeamsReactionHandler(deps) {
|
|
|
3413
3440
|
log.debug?.("reaction activity missing from.id; skipping");
|
|
3414
3441
|
return;
|
|
3415
3442
|
}
|
|
3416
|
-
const
|
|
3443
|
+
const rawConversationId = activity.conversation?.id ?? "";
|
|
3444
|
+
const conversationId = require_resolve_allowlist.normalizeMSTeamsConversationId(rawConversationId);
|
|
3417
3445
|
const conversationType = activity.conversation?.conversationType ?? "personal";
|
|
3418
3446
|
const isGroupChat = conversationType === "groupChat" || activity.conversation?.isGroup === true;
|
|
3419
3447
|
const isChannel = conversationType === "channel";
|
|
@@ -3830,60 +3858,61 @@ async function handleMSTeamsFileConsentInvoke(context, log) {
|
|
|
3830
3858
|
return true;
|
|
3831
3859
|
}
|
|
3832
3860
|
}
|
|
3833
|
-
if (consentResponse.action === "accept" && consentResponse.uploadInfo)
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
try {
|
|
3840
|
-
await require_messenger.uploadToConsentUrl({
|
|
3841
|
-
url: consentResponse.uploadInfo.uploadUrl,
|
|
3842
|
-
buffer: pendingFile.buffer,
|
|
3843
|
-
contentType: pendingFile.contentType
|
|
3844
|
-
});
|
|
3845
|
-
const fileInfoCard = require_messenger.buildFileInfoCard({
|
|
3846
|
-
filename: consentResponse.uploadInfo.name,
|
|
3847
|
-
contentUrl: consentResponse.uploadInfo.contentUrl,
|
|
3848
|
-
uniqueId: consentResponse.uploadInfo.uniqueId,
|
|
3849
|
-
fileType: consentResponse.uploadInfo.fileType
|
|
3850
|
-
});
|
|
3851
|
-
if (!pendingFile.consentCardActivityId) await context.sendActivity({
|
|
3852
|
-
type: "message",
|
|
3853
|
-
attachments: [fileInfoCard]
|
|
3861
|
+
if (consentResponse.action === "accept" && consentResponse.uploadInfo) {
|
|
3862
|
+
if (pendingFile) {
|
|
3863
|
+
log.debug?.("user accepted file consent, uploading", {
|
|
3864
|
+
uploadId,
|
|
3865
|
+
filename: pendingFile.filename,
|
|
3866
|
+
size: pendingFile.buffer.length
|
|
3854
3867
|
});
|
|
3855
|
-
|
|
3856
|
-
await
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3868
|
+
try {
|
|
3869
|
+
await require_messenger.uploadToConsentUrl({
|
|
3870
|
+
url: consentResponse.uploadInfo.uploadUrl,
|
|
3871
|
+
buffer: pendingFile.buffer,
|
|
3872
|
+
contentType: pendingFile.contentType
|
|
3873
|
+
});
|
|
3874
|
+
const fileInfoCard = require_messenger.buildFileInfoCard({
|
|
3875
|
+
filename: consentResponse.uploadInfo.name,
|
|
3876
|
+
contentUrl: consentResponse.uploadInfo.contentUrl,
|
|
3877
|
+
uniqueId: consentResponse.uploadInfo.uniqueId,
|
|
3878
|
+
fileType: consentResponse.uploadInfo.fileType
|
|
3860
3879
|
});
|
|
3861
|
-
|
|
3862
|
-
await context.sendActivity({
|
|
3880
|
+
if (!pendingFile.consentCardActivityId) await context.sendActivity({
|
|
3863
3881
|
type: "message",
|
|
3864
3882
|
attachments: [fileInfoCard]
|
|
3865
3883
|
});
|
|
3884
|
+
if (pendingFile.consentCardActivityId) try {
|
|
3885
|
+
await context.updateActivity({
|
|
3886
|
+
id: pendingFile.consentCardActivityId,
|
|
3887
|
+
type: "message",
|
|
3888
|
+
attachments: [fileInfoCard]
|
|
3889
|
+
});
|
|
3890
|
+
} catch {
|
|
3891
|
+
await context.sendActivity({
|
|
3892
|
+
type: "message",
|
|
3893
|
+
attachments: [fileInfoCard]
|
|
3894
|
+
});
|
|
3895
|
+
}
|
|
3896
|
+
log.info("file upload complete", {
|
|
3897
|
+
uploadId,
|
|
3898
|
+
filename: consentResponse.uploadInfo.name,
|
|
3899
|
+
uniqueId: consentResponse.uploadInfo.uniqueId
|
|
3900
|
+
});
|
|
3901
|
+
} catch (err) {
|
|
3902
|
+
log.error("file upload failed", {
|
|
3903
|
+
uploadId,
|
|
3904
|
+
error: require_channel_setup.formatUnknownError(err)
|
|
3905
|
+
});
|
|
3906
|
+
await context.sendActivity("File upload failed. Please try again.");
|
|
3907
|
+
} finally {
|
|
3908
|
+
require_messenger.removePendingUpload(uploadId);
|
|
3909
|
+
await require_messenger.removePendingUploadFs(uploadId);
|
|
3866
3910
|
}
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
uniqueId: consentResponse.uploadInfo.uniqueId
|
|
3871
|
-
});
|
|
3872
|
-
} catch (err) {
|
|
3873
|
-
log.error("file upload failed", {
|
|
3874
|
-
uploadId,
|
|
3875
|
-
error: require_channel_setup.formatUnknownError(err)
|
|
3876
|
-
});
|
|
3877
|
-
await context.sendActivity("File upload failed. Please try again.");
|
|
3878
|
-
} finally {
|
|
3879
|
-
require_messenger.removePendingUpload(uploadId);
|
|
3880
|
-
await require_messenger.removePendingUploadFs(uploadId);
|
|
3911
|
+
} else {
|
|
3912
|
+
log.debug?.("pending file not found for consent", { uploadId });
|
|
3913
|
+
await context.sendActivity(expiredUploadMessage);
|
|
3881
3914
|
}
|
|
3882
3915
|
} else {
|
|
3883
|
-
log.debug?.("pending file not found for consent", { uploadId });
|
|
3884
|
-
await context.sendActivity(expiredUploadMessage);
|
|
3885
|
-
}
|
|
3886
|
-
else {
|
|
3887
3916
|
log.debug?.("user declined file consent", { uploadId });
|
|
3888
3917
|
require_messenger.removePendingUpload(uploadId);
|
|
3889
3918
|
await require_messenger.removePendingUploadFs(uploadId);
|
|
@@ -4178,7 +4207,8 @@ async function monitorMSTeamsProvider(opts) {
|
|
|
4178
4207
|
const unresolved = [];
|
|
4179
4208
|
for (const entry of resolved) if (entry.resolved && entry.id) additions.push(entry.id);
|
|
4180
4209
|
else unresolved.push(entry.input);
|
|
4181
|
-
|
|
4210
|
+
const mapping = resolved.filter((entry) => entry.resolved && entry.id).map((entry) => `${entry.input}→${entry.id}`);
|
|
4211
|
+
(0, openclaw_plugin_sdk_allow_from.summarizeMapping)(label, mapping, unresolved, runtime);
|
|
4182
4212
|
return {
|
|
4183
4213
|
additions,
|
|
4184
4214
|
unresolved
|
|
@@ -4236,10 +4266,10 @@ async function monitorMSTeamsProvider(opts) {
|
|
|
4236
4266
|
};
|
|
4237
4267
|
const port = msteamsCfg.webhook?.port ?? 3978;
|
|
4238
4268
|
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "msteams");
|
|
4239
|
-
const mediaMaxBytes = (0,
|
|
4269
|
+
const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
|
|
4240
4270
|
cfg,
|
|
4241
4271
|
resolveChannelLimitMb: ({ cfg: channelCfg }) => channelCfg.channels?.msteams?.mediaMaxMb
|
|
4242
|
-
}) ??
|
|
4272
|
+
}) ?? 8388608;
|
|
4243
4273
|
const conversationStore = opts.conversationStore ?? require_polls.createMSTeamsConversationStoreState();
|
|
4244
4274
|
const pollStore = opts.pollStore ?? require_polls.createMSTeamsPollStoreState();
|
|
4245
4275
|
log.info(`starting provider (port ${port})`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
2
|
-
const require_polls = require("./polls-
|
|
2
|
+
const require_polls = require("./polls-P86qBpeV.cjs");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
//#region extensions/msteams/src/sso-token-store.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CoKmLXYe.cjs");
|
|
2
2
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
3
3
|
let openclaw_plugin_sdk_approval_auth_runtime = require("openclaw/plugin-sdk/approval-auth-runtime");
|
|
4
4
|
let openclaw_plugin_sdk_routing = require("openclaw/plugin-sdk/routing");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/msteams",
|
|
3
|
-
"version": "2026.9.1
|
|
3
|
+
"version": "2026.9.1",
|
|
4
4
|
"description": "OpenClaw Microsoft Teams channel plugin for bot conversations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
"@microsoft/teams.api": "2.0.15",
|
|
13
13
|
"@microsoft/teams.apps": "2.0.15",
|
|
14
14
|
"express": "5.2.1",
|
|
15
|
-
"typebox": "1.3.
|
|
15
|
+
"typebox": "1.3.17",
|
|
16
16
|
"zod": "4.4.3"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@microsoft/teams.common": "2.0.15",
|
|
20
20
|
"@openclaw/plugin-sdk": "workspace:*",
|
|
21
|
-
"jose": "6.2.
|
|
21
|
+
"jose": "6.2.10",
|
|
22
22
|
"openclaw": "workspace:*"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"openclaw": ">=2026.9.1
|
|
25
|
+
"openclaw": ">=2026.9.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependenciesMeta": {
|
|
28
28
|
"openclaw": {
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"minHostVersion": ">=2026.4.10"
|
|
73
73
|
},
|
|
74
74
|
"compat": {
|
|
75
|
-
"pluginApi": ">=2026.9.1
|
|
75
|
+
"pluginApi": ">=2026.9.1"
|
|
76
76
|
},
|
|
77
77
|
"build": {
|
|
78
|
-
"openclawVersion": "2026.9.1
|
|
78
|
+
"openclawVersion": "2026.9.1",
|
|
79
79
|
"runtimeFormat": "cjs"
|
|
80
80
|
},
|
|
81
81
|
"release": {
|