@openclaw/msteams 2026.7.2-beta.4 → 2026.7.2-beta.7
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/README.md +1 -1
- package/dist/api.cjs +2 -2
- package/dist/{channel-D_epy05a.cjs → channel-C7QxRjBW.cjs} +16 -134
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/{channel.runtime-D6MyENlx.cjs → channel.runtime-DjY6d_hd.cjs} +19 -14
- package/dist/{config-schema-BTnLgWAe.cjs → config-schema-C4CszdDi.cjs} +12 -28
- package/dist/{delegated-state-DOSCHaAB.cjs → delegated-state-DiEz9JIa.cjs} +0 -28
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +9 -7
- package/dist/{messenger-BcpkE82v.cjs → messenger-DTiaLTDO.cjs} +43 -32
- package/dist/{oauth-Bv-hLxJo.cjs → oauth-CW6jVGp8.cjs} +1 -1
- package/dist/{polls-CWExq2xZ.cjs → polls-BWKNpBSg.cjs} +30 -3
- package/dist/{resolve-allowlist-CgA2KHN8.cjs → resolve-allowlist-CEj9sABO.cjs} +125 -12
- package/dist/runtime-api.cjs +1 -1
- package/dist/setup-plugin-api.cjs +6 -34
- package/dist/{setup-surface-BWSGtAxk.cjs → setup-surface-ByWjaXEn.cjs} +59 -36
- package/dist/{src-Gqmhf6Hw.cjs → src-B_BdEvcr.cjs} +1305 -1021
- package/dist/{sso-token-store-OSg229re.cjs → sso-token-store-TKYk_Ms7.cjs} +1 -1
- package/package.json +5 -6
- package/npm-shrinkwrap.json +0 -1748
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for Microsoft Teams bot conversations.
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/msteams
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Configure the Teams bot credentials and trusted service URLs in OpenClaw, then connect the bot to the teams or chats where agents should operate.
|
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_channel = require("./channel-
|
|
3
|
-
const require_setup_surface = require("./setup-surface-
|
|
2
|
+
const require_channel = require("./channel-C7QxRjBW.cjs");
|
|
3
|
+
const require_setup_surface = require("./setup-surface-ByWjaXEn.cjs");
|
|
4
4
|
exports.createMSTeamsSetupWizardBase = require_setup_surface.createMSTeamsSetupWizardBase;
|
|
5
5
|
exports.msteamsPlugin = require_channel.msteamsPlugin;
|
|
6
6
|
exports.msteamsSetupAdapter = require_setup_surface.msteamsSetupAdapter;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
require("./runtime-api.cjs");
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
2
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CEj9sABO.cjs");
|
|
3
|
+
const require_setup_surface = require("./setup-surface-ByWjaXEn.cjs");
|
|
4
|
+
const require_config_schema = require("./config-schema-C4CszdDi.cjs");
|
|
5
5
|
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
6
|
-
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
7
|
-
let openclaw_plugin_sdk_channel_config_helpers = require("openclaw/plugin-sdk/channel-config-helpers");
|
|
8
6
|
let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
|
|
9
7
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
10
8
|
let openclaw_plugin_sdk_channel_pairing = require("openclaw/plugin-sdk/channel-pairing");
|
|
@@ -17,14 +15,14 @@ let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/str
|
|
|
17
15
|
let typebox = require("typebox");
|
|
18
16
|
let openclaw_plugin_sdk_approval_auth_runtime = require("openclaw/plugin-sdk/approval-auth-runtime");
|
|
19
17
|
let openclaw_plugin_sdk_channel_actions = require("openclaw/plugin-sdk/channel-actions");
|
|
20
|
-
let openclaw_plugin_sdk_html_entity_runtime = require("openclaw/plugin-sdk/html-entity-runtime");
|
|
21
18
|
let openclaw_plugin_sdk_routing = require("openclaw/plugin-sdk/routing");
|
|
22
19
|
let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
|
|
20
|
+
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
23
21
|
let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
|
|
24
22
|
let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
|
|
25
|
-
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
26
23
|
let openclaw_plugin_sdk_text_chunking = require("openclaw/plugin-sdk/text-chunking");
|
|
27
24
|
let openclaw_plugin_sdk_channel_status = require("openclaw/plugin-sdk/channel-status");
|
|
25
|
+
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
28
26
|
//#region extensions/msteams/src/approval-auth.ts
|
|
29
27
|
const MSTEAMS_ID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
30
28
|
function normalizeMSTeamsApproverId(value) {
|
|
@@ -34,13 +32,13 @@ function normalizeMSTeamsApproverId(value) {
|
|
|
34
32
|
if (!id) return;
|
|
35
33
|
return MSTEAMS_ID_RE.test(id) ? id : void 0;
|
|
36
34
|
}
|
|
37
|
-
function resolveMSTeamsChannelConfig
|
|
35
|
+
function resolveMSTeamsChannelConfig(cfg) {
|
|
38
36
|
return cfg.channels?.msteams;
|
|
39
37
|
}
|
|
40
38
|
const msTeamsApprovalAuth = (0, openclaw_plugin_sdk_approval_auth_runtime.createChannelApprovalAuth)({
|
|
41
39
|
channelLabel: "Microsoft Teams",
|
|
42
40
|
resolveInputs: ({ cfg }) => {
|
|
43
|
-
const channel = resolveMSTeamsChannelConfig
|
|
41
|
+
const channel = resolveMSTeamsChannelConfig(cfg);
|
|
44
42
|
return {
|
|
45
43
|
allowFrom: channel?.allowFrom,
|
|
46
44
|
defaultTo: channel?.defaultTo
|
|
@@ -185,6 +183,7 @@ function resolveMSTeamsGroupToolPolicy(params) {
|
|
|
185
183
|
groupId: params.groupId
|
|
186
184
|
});
|
|
187
185
|
const senderScope = {
|
|
186
|
+
senderPolicyMode: params.senderPolicyMode,
|
|
188
187
|
senderId: params.senderId,
|
|
189
188
|
senderName: params.senderName,
|
|
190
189
|
senderUsername: params.senderUsername,
|
|
@@ -533,62 +532,6 @@ async function assertMSTeamsTeamEnumerationAllowed(params) {
|
|
|
533
532
|
return stableTeamId;
|
|
534
533
|
}
|
|
535
534
|
//#endregion
|
|
536
|
-
//#region extensions/msteams/src/inbound.ts
|
|
537
|
-
/**
|
|
538
|
-
* Strip HTML tags, preserving text content.
|
|
539
|
-
*/
|
|
540
|
-
function htmlToPlainText(html) {
|
|
541
|
-
return (0, openclaw_plugin_sdk_html_entity_runtime.decodeHtmlEntities)(html.replace(/<[^>]*>/g, " ")).replaceAll("\xA0", " ").replace(/\s+/g, " ").trim();
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Extract quote info from MS Teams HTML reply attachments.
|
|
545
|
-
* Teams wraps quoted content in a blockquote with itemtype="http://schema.skype.com/Reply".
|
|
546
|
-
*/
|
|
547
|
-
function extractMSTeamsQuoteInfo(attachments) {
|
|
548
|
-
for (const att of attachments) {
|
|
549
|
-
let content = "";
|
|
550
|
-
if (typeof att.content === "string") content = att.content;
|
|
551
|
-
else if (typeof att.content === "object" && att.content !== null) {
|
|
552
|
-
const record = att.content;
|
|
553
|
-
content = typeof record.text === "string" ? record.text : typeof record.body === "string" ? record.body : "";
|
|
554
|
-
}
|
|
555
|
-
if (!content) continue;
|
|
556
|
-
if (!content.includes("http://schema.skype.com/Reply")) continue;
|
|
557
|
-
const senderMatch = /<strong[^>]*itemprop=["']mri["'][^>]*>(.*?)<\/strong>/i.exec(content);
|
|
558
|
-
const sender = senderMatch?.[1] ? htmlToPlainText(senderMatch[1]) : void 0;
|
|
559
|
-
const bodyMatch = /<p[^>]*itemprop=["']copy["'][^>]*>(.*?)<\/p>/is.exec(content) ?? /<p[^>]*itemprop=["']preview["'][^>]*>(.*?)<\/p>/is.exec(content);
|
|
560
|
-
const body = bodyMatch?.[1] ? htmlToPlainText(bodyMatch[1]) : void 0;
|
|
561
|
-
const id = /<blockquote[^>]*\bitemid=["']([^"']+)["'][^>]*>/is.exec(content)?.[1]?.trim() || void 0;
|
|
562
|
-
if (body) return {
|
|
563
|
-
sender: sender ?? "unknown",
|
|
564
|
-
body,
|
|
565
|
-
...id ? { id } : {}
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
function normalizeMSTeamsConversationId(raw) {
|
|
570
|
-
return raw.split(";")[0] ?? raw;
|
|
571
|
-
}
|
|
572
|
-
function extractMSTeamsConversationMessageId(raw) {
|
|
573
|
-
if (!raw) return;
|
|
574
|
-
return (/(?:^|;)messageid=([^;]+)/i.exec(raw)?.[1]?.trim() ?? "") || void 0;
|
|
575
|
-
}
|
|
576
|
-
function parseMSTeamsActivityTimestamp(value) {
|
|
577
|
-
if (!value) return;
|
|
578
|
-
if (value instanceof Date) return value;
|
|
579
|
-
if (typeof value !== "string") return;
|
|
580
|
-
const date = new Date(value);
|
|
581
|
-
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
582
|
-
}
|
|
583
|
-
function stripMSTeamsMentionTags(text) {
|
|
584
|
-
return text.replace(/<at[^>]*>.*?<\/at>/gi, "").trim();
|
|
585
|
-
}
|
|
586
|
-
function wasMSTeamsBotMentioned(activity) {
|
|
587
|
-
const botId = activity.recipient?.id;
|
|
588
|
-
if (!botId) return false;
|
|
589
|
-
return (activity.entities ?? []).some((e) => e.type === "mention" && e.mentioned?.id === botId);
|
|
590
|
-
}
|
|
591
|
-
//#endregion
|
|
592
535
|
//#region extensions/msteams/src/monitor-handler/thread-session.ts
|
|
593
536
|
const TRAILING_THREAD_SUFFIX = /(?::thread:[^:]+)+$/;
|
|
594
537
|
function resolveMSTeamsRouteSessionKey(params) {
|
|
@@ -608,9 +551,9 @@ function resolveMSTeamsOutboundSessionRoute(params) {
|
|
|
608
551
|
const isUser = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(trimmed).startsWith("user:");
|
|
609
552
|
const rawId = (0, openclaw_plugin_sdk_channel_core.stripTargetKindPrefix)(trimmed);
|
|
610
553
|
if (!rawId) return null;
|
|
611
|
-
const conversationId = normalizeMSTeamsConversationId(rawId);
|
|
554
|
+
const conversationId = require_resolve_allowlist.normalizeMSTeamsConversationId(rawId);
|
|
612
555
|
const isChannel = !isUser && /@thread\.tacv2/i.test(conversationId);
|
|
613
|
-
const embeddedThreadId = extractMSTeamsConversationMessageId(rawId);
|
|
556
|
+
const embeddedThreadId = require_resolve_allowlist.extractMSTeamsConversationMessageId(rawId);
|
|
614
557
|
const explicitThreadId = params.threadId ?? params.replyToId;
|
|
615
558
|
const channelThreadId = embeddedThreadId ?? (explicitThreadId !== void 0 && explicitThreadId !== null ? String(explicitThreadId) : void 0);
|
|
616
559
|
const resolvedKind = params.resolvedTarget?.kind;
|
|
@@ -642,16 +585,6 @@ function resolveMSTeamsOutboundSessionRoute(params) {
|
|
|
642
585
|
}
|
|
643
586
|
//#endregion
|
|
644
587
|
//#region extensions/msteams/src/channel.ts
|
|
645
|
-
const meta = {
|
|
646
|
-
id: "msteams",
|
|
647
|
-
label: "Microsoft Teams",
|
|
648
|
-
selectionLabel: "Microsoft Teams (Bot Framework)",
|
|
649
|
-
docsPath: "/channels/msteams",
|
|
650
|
-
docsLabel: "msteams",
|
|
651
|
-
blurb: "Teams SDK; enterprise support.",
|
|
652
|
-
aliases: ["teams"],
|
|
653
|
-
order: 60
|
|
654
|
-
};
|
|
655
588
|
const TEAMS_GRAPH_PERMISSION_HINTS = {
|
|
656
589
|
"ChannelMessage.Read.All": "channel history",
|
|
657
590
|
"Chat.Read.All": "chat history",
|
|
@@ -671,23 +604,7 @@ const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.cr
|
|
|
671
604
|
resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
|
|
672
605
|
collect: ({ groupPolicy }) => groupPolicy === "open" ? ["- MS Teams groups: groupPolicy=\"open\" allows any member to trigger (mention-gated). Set channels.msteams.groupPolicy=\"allowlist\" + channels.msteams.groupAllowFrom to restrict senders."] : []
|
|
673
606
|
});
|
|
674
|
-
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-
|
|
675
|
-
const resolveMSTeamsChannelConfig = (cfg) => ({
|
|
676
|
-
allowFrom: cfg.channels?.msteams?.allowFrom,
|
|
677
|
-
defaultTo: cfg.channels?.msteams?.defaultTo
|
|
678
|
-
});
|
|
679
|
-
const msteamsConfigAdapter = (0, openclaw_plugin_sdk_channel_config_helpers.createTopLevelChannelConfigAdapter)({
|
|
680
|
-
sectionKey: "msteams",
|
|
681
|
-
resolveAccount: (cfg) => ({
|
|
682
|
-
accountId: openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID,
|
|
683
|
-
enabled: cfg.channels?.msteams?.enabled !== false,
|
|
684
|
-
configured: Boolean(require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams))
|
|
685
|
-
}),
|
|
686
|
-
resolveAccessorAccount: ({ cfg }) => resolveMSTeamsChannelConfig(cfg),
|
|
687
|
-
resolveAllowFrom: (account) => account.allowFrom,
|
|
688
|
-
formatAllowFrom: (allowFrom) => (0, openclaw_plugin_sdk_allow_from.formatAllowFromLowercase)({ allowFrom }),
|
|
689
|
-
resolveDefaultTo: (account) => account.defaultTo
|
|
690
|
-
});
|
|
607
|
+
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-DjY6d_hd.cjs")), "msTeamsChannelRuntime");
|
|
691
608
|
function jsonActionResult(data) {
|
|
692
609
|
return {
|
|
693
610
|
content: [{
|
|
@@ -888,6 +805,7 @@ const msteamsChannelOutbound = {
|
|
|
888
805
|
chunker: openclaw_plugin_sdk_text_chunking.chunkTextForOutbound,
|
|
889
806
|
chunkerMode: "markdown",
|
|
890
807
|
textChunkLimit: 4e3,
|
|
808
|
+
resolveEffectiveTextChunkLimit: ({ fallbackLimit }) => typeof fallbackLimit === "number" && fallbackLimit > 0 ? Math.min(fallbackLimit, 4e3) : 4e3,
|
|
891
809
|
pollMaxOptions: 12,
|
|
892
810
|
deliveryCapabilities: { durableFinal: {
|
|
893
811
|
text: true,
|
|
@@ -926,8 +844,8 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
926
844
|
base: {
|
|
927
845
|
id: "msteams",
|
|
928
846
|
meta: {
|
|
929
|
-
...
|
|
930
|
-
aliases: [...
|
|
847
|
+
...require_setup_surface.msteamsMeta,
|
|
848
|
+
aliases: [...require_setup_surface.msteamsMeta.aliases]
|
|
931
849
|
},
|
|
932
850
|
setupWizard: require_setup_surface.msteamsSetupWizard,
|
|
933
851
|
capabilities: {
|
|
@@ -949,7 +867,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
949
867
|
reload: { configPrefixes: ["channels.msteams"] },
|
|
950
868
|
configSchema: require_config_schema.MSTeamsChannelConfigSchema,
|
|
951
869
|
config: {
|
|
952
|
-
...msteamsConfigAdapter,
|
|
870
|
+
...require_setup_surface.msteamsConfigAdapter,
|
|
953
871
|
isConfigured: (_account, cfg) => Boolean(require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams)),
|
|
954
872
|
describeAccount: (account) => (0, openclaw_plugin_sdk_account_helpers.describeAccountSnapshot)({
|
|
955
873
|
account,
|
|
@@ -1566,7 +1484,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1566
1484
|
})
|
|
1567
1485
|
}),
|
|
1568
1486
|
gateway: { startAccount: async (ctx) => {
|
|
1569
|
-
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-
|
|
1487
|
+
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-B_BdEvcr.cjs"));
|
|
1570
1488
|
const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
|
|
1571
1489
|
ctx.setStatus({
|
|
1572
1490
|
accountId: ctx.accountId,
|
|
@@ -1621,36 +1539,12 @@ Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
|
|
|
1621
1539
|
return buildMSTeamsPresentationCard;
|
|
1622
1540
|
}
|
|
1623
1541
|
});
|
|
1624
|
-
Object.defineProperty(exports, "extractMSTeamsConversationMessageId", {
|
|
1625
|
-
enumerable: true,
|
|
1626
|
-
get: function() {
|
|
1627
|
-
return extractMSTeamsConversationMessageId;
|
|
1628
|
-
}
|
|
1629
|
-
});
|
|
1630
|
-
Object.defineProperty(exports, "extractMSTeamsQuoteInfo", {
|
|
1631
|
-
enumerable: true,
|
|
1632
|
-
get: function() {
|
|
1633
|
-
return extractMSTeamsQuoteInfo;
|
|
1634
|
-
}
|
|
1635
|
-
});
|
|
1636
1542
|
Object.defineProperty(exports, "msteamsPlugin", {
|
|
1637
1543
|
enumerable: true,
|
|
1638
1544
|
get: function() {
|
|
1639
1545
|
return msteamsPlugin;
|
|
1640
1546
|
}
|
|
1641
1547
|
});
|
|
1642
|
-
Object.defineProperty(exports, "normalizeMSTeamsConversationId", {
|
|
1643
|
-
enumerable: true,
|
|
1644
|
-
get: function() {
|
|
1645
|
-
return normalizeMSTeamsConversationId;
|
|
1646
|
-
}
|
|
1647
|
-
});
|
|
1648
|
-
Object.defineProperty(exports, "parseMSTeamsActivityTimestamp", {
|
|
1649
|
-
enumerable: true,
|
|
1650
|
-
get: function() {
|
|
1651
|
-
return parseMSTeamsActivityTimestamp;
|
|
1652
|
-
}
|
|
1653
|
-
});
|
|
1654
1548
|
Object.defineProperty(exports, "resolveMSTeamsAllowlistMatch", {
|
|
1655
1549
|
enumerable: true,
|
|
1656
1550
|
get: function() {
|
|
@@ -1675,15 +1569,3 @@ Object.defineProperty(exports, "resolveMSTeamsRouteSessionKey", {
|
|
|
1675
1569
|
return resolveMSTeamsRouteSessionKey;
|
|
1676
1570
|
}
|
|
1677
1571
|
});
|
|
1678
|
-
Object.defineProperty(exports, "stripMSTeamsMentionTags", {
|
|
1679
|
-
enumerable: true,
|
|
1680
|
-
get: function() {
|
|
1681
|
-
return stripMSTeamsMentionTags;
|
|
1682
|
-
}
|
|
1683
|
-
});
|
|
1684
|
-
Object.defineProperty(exports, "wasMSTeamsBotMentioned", {
|
|
1685
|
-
enumerable: true,
|
|
1686
|
-
get: function() {
|
|
1687
|
-
return wasMSTeamsBotMentioned;
|
|
1688
|
-
}
|
|
1689
|
-
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_config_schema = require("./config-schema-
|
|
2
|
+
const require_config_schema = require("./config-schema-C4CszdDi.cjs");
|
|
3
3
|
exports.MSTeamsChannelConfigSchema = require_config_schema.MSTeamsChannelConfigSchema;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
const require_polls = require("./polls-BWKNpBSg.cjs");
|
|
1
2
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
2
3
|
require("./runtime-api.cjs");
|
|
3
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
4
|
-
const require_channel = require("./channel-
|
|
5
|
-
const require_setup_surface = require("./setup-surface-
|
|
6
|
-
const
|
|
7
|
-
const require_messenger = require("./messenger-BcpkE82v.cjs");
|
|
4
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CEj9sABO.cjs");
|
|
5
|
+
const require_channel = require("./channel-C7QxRjBW.cjs");
|
|
6
|
+
const require_setup_surface = require("./setup-surface-ByWjaXEn.cjs");
|
|
7
|
+
const require_messenger = require("./messenger-DTiaLTDO.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");
|
|
@@ -771,7 +771,7 @@ async function sendMessageMSTeams(params) {
|
|
|
771
771
|
cfg,
|
|
772
772
|
to
|
|
773
773
|
});
|
|
774
|
-
const { app, conversationId, ref, log, conversationType, tokenProvider, sharePointSiteId, sdkCloudOptions } = ctx;
|
|
774
|
+
const { app, conversationId, ref, log, conversationType, replyStyle, tokenProvider, sharePointSiteId, sdkCloudOptions } = ctx;
|
|
775
775
|
log.debug?.("sending proactive message", {
|
|
776
776
|
conversationId,
|
|
777
777
|
conversationType,
|
|
@@ -883,6 +883,7 @@ async function sendMessageMSTeams(params) {
|
|
|
883
883
|
text: messageText || void 0,
|
|
884
884
|
attachments: [fileCardAttachment]
|
|
885
885
|
},
|
|
886
|
+
threadActivityId: replyStyle === "thread" && conversationType === "channel" ? ref.threadId ?? ref.activityId : void 0,
|
|
886
887
|
serviceUrlBoundary: sdkCloudOptions
|
|
887
888
|
});
|
|
888
889
|
log.info("sent native file card", {
|
|
@@ -955,8 +956,11 @@ async function sendTextWithMedia(ctx, text, mediaUrl) {
|
|
|
955
956
|
})
|
|
956
957
|
};
|
|
957
958
|
}
|
|
958
|
-
async function sendProactiveActivityRaw({ app, ref, activity, serviceUrlBoundary }) {
|
|
959
|
-
return require_messenger.extractMessageId(await require_messenger.sendMSTeamsActivityWithReference(app, require_messenger.buildConversationReference(ref), activity, {
|
|
959
|
+
async function sendProactiveActivityRaw({ app, ref, activity, threadActivityId, serviceUrlBoundary }) {
|
|
960
|
+
return require_messenger.extractMessageId(await require_messenger.sendMSTeamsActivityWithReference(app, require_messenger.buildConversationReference(ref), activity, {
|
|
961
|
+
...threadActivityId ? { threadActivityId } : {},
|
|
962
|
+
serviceUrlBoundary
|
|
963
|
+
})) ?? "unknown";
|
|
960
964
|
}
|
|
961
965
|
async function sendProactiveActivity({ app, ref, activity, errorPrefix, serviceUrlBoundary }) {
|
|
962
966
|
try {
|
|
@@ -1119,10 +1123,10 @@ async function deleteMessageMSTeams(params) {
|
|
|
1119
1123
|
}
|
|
1120
1124
|
//#endregion
|
|
1121
1125
|
//#region extensions/msteams/src/outbound.ts
|
|
1122
|
-
function asObjectRecord(value) {
|
|
1123
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
1124
|
-
}
|
|
1125
1126
|
const MSTEAMS_TEXT_CHUNK_LIMIT = 4e3;
|
|
1127
|
+
function resolveMSTeamsEffectiveTextChunkLimit(configuredLimit) {
|
|
1128
|
+
return typeof configuredLimit === "number" && configuredLimit > 0 ? Math.min(configuredLimit, MSTEAMS_TEXT_CHUNK_LIMIT) : MSTEAMS_TEXT_CHUNK_LIMIT;
|
|
1129
|
+
}
|
|
1126
1130
|
function resolveMSTeamsTextSend(params) {
|
|
1127
1131
|
return (0, openclaw_plugin_sdk_channel_outbound.resolveOutboundSendDep)(params.deps, "msteams") ?? ((to, text) => sendMessageMSTeams({
|
|
1128
1132
|
cfg: params.cfg,
|
|
@@ -1145,6 +1149,7 @@ const msteamsOutbound = {
|
|
|
1145
1149
|
chunker: openclaw_plugin_sdk_text_chunking.chunkTextForOutbound,
|
|
1146
1150
|
chunkerMode: "markdown",
|
|
1147
1151
|
textChunkLimit: MSTEAMS_TEXT_CHUNK_LIMIT,
|
|
1152
|
+
resolveEffectiveTextChunkLimit: ({ fallbackLimit }) => resolveMSTeamsEffectiveTextChunkLimit(fallbackLimit),
|
|
1148
1153
|
pollMaxOptions: 12,
|
|
1149
1154
|
deliveryCapabilities: { durableFinal: {
|
|
1150
1155
|
text: true,
|
|
@@ -1159,7 +1164,7 @@ const msteamsOutbound = {
|
|
|
1159
1164
|
presentation,
|
|
1160
1165
|
text: payload.text
|
|
1161
1166
|
});
|
|
1162
|
-
const msteamsData =
|
|
1167
|
+
const msteamsData = (0, openclaw_plugin_sdk_string_coerce_runtime.asOptionalRecord)(payload.channelData?.msteams) ?? {};
|
|
1163
1168
|
return {
|
|
1164
1169
|
...payload,
|
|
1165
1170
|
channelData: {
|
|
@@ -1172,7 +1177,7 @@ const msteamsOutbound = {
|
|
|
1172
1177
|
};
|
|
1173
1178
|
},
|
|
1174
1179
|
sendPayload: async ({ cfg, to, text, mediaUrl, mediaLocalRoots, mediaReadFile, payload, deps, onDeliveryResult }) => {
|
|
1175
|
-
const presentationCard =
|
|
1180
|
+
const presentationCard = (0, openclaw_plugin_sdk_string_coerce_runtime.asOptionalRecord)(payload.channelData?.msteams)?.presentationCard;
|
|
1176
1181
|
if (presentationCard && typeof presentationCard === "object" && !Array.isArray(presentationCard)) return (0, openclaw_plugin_sdk_channel_send_result.attachChannelToResult)("msteams", await sendAdaptiveCardMSTeams({
|
|
1177
1182
|
cfg,
|
|
1178
1183
|
to,
|
|
@@ -1206,7 +1211,7 @@ const msteamsOutbound = {
|
|
|
1206
1211
|
cfg,
|
|
1207
1212
|
deps
|
|
1208
1213
|
});
|
|
1209
|
-
const chunks = (0, openclaw_plugin_sdk_reply_payload.resolveTextChunksWithFallback)(text, (0, openclaw_plugin_sdk_text_chunking.chunkTextForOutbound)(text,
|
|
1214
|
+
const chunks = (0, openclaw_plugin_sdk_reply_payload.resolveTextChunksWithFallback)(text, (0, openclaw_plugin_sdk_text_chunking.chunkTextForOutbound)(text, resolveMSTeamsEffectiveTextChunkLimit(cfg.channels?.msteams?.textChunkLimit)));
|
|
1210
1215
|
let result;
|
|
1211
1216
|
for (const chunk of chunks) {
|
|
1212
1217
|
result = await send(to, chunk);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
|
|
1
2
|
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
2
3
|
let openclaw_plugin_sdk_channel_config_schema = require("openclaw/plugin-sdk/channel-config-schema");
|
|
3
4
|
let zod = require("zod");
|
|
@@ -23,34 +24,17 @@ const msTeamsChannelConfigUiHints = {
|
|
|
23
24
|
label: "MS Teams Graph Media Fallback",
|
|
24
25
|
help: "Query Microsoft Graph for unresolved channel or group-chat HTML media. Adds one lookup per matching message when enabled (default: false)."
|
|
25
26
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
"streaming.progress.maxLines": {
|
|
39
|
-
label: "MS Teams Progress Max Lines",
|
|
40
|
-
help: "Maximum number of compact progress lines to keep below the progress title (default: 8)."
|
|
41
|
-
},
|
|
42
|
-
"streaming.progress.maxLineChars": {
|
|
43
|
-
label: "MS Teams Progress Max Line Chars",
|
|
44
|
-
help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes."
|
|
45
|
-
},
|
|
46
|
-
"streaming.progress.toolProgress": {
|
|
47
|
-
label: "MS Teams Progress Tool Lines",
|
|
48
|
-
help: "Show compact tool/progress lines in progress mode (default: true). Set false to keep only the title until final delivery."
|
|
49
|
-
},
|
|
50
|
-
"streaming.progress.commandText": {
|
|
51
|
-
label: "MS Teams Progress Command Text",
|
|
52
|
-
help: "Command/exec detail in progress lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
|
|
53
|
-
}
|
|
27
|
+
...(0, openclaw_plugin_sdk_channel_core.createChannelConfigUiHints)({
|
|
28
|
+
channelLabel: "MS Teams",
|
|
29
|
+
streaming: { "": {
|
|
30
|
+
label: "MS Teams Streaming",
|
|
31
|
+
help: "Microsoft Teams preview/progress streaming mode: \"off\" | \"partial\" | \"block\" | \"progress\". Personal chats use Teams native streaminfo progress when available."
|
|
32
|
+
} },
|
|
33
|
+
progress: {
|
|
34
|
+
labels: "openclaw",
|
|
35
|
+
titleWording: true
|
|
36
|
+
}
|
|
37
|
+
})
|
|
54
38
|
};
|
|
55
39
|
//#endregion
|
|
56
40
|
//#region extensions/msteams/src/config-schema.ts
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
1
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
24
2
|
//#region extensions/msteams/src/delegated-state.ts
|
|
25
3
|
const MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME = "msteams-delegated.json";
|
|
@@ -72,12 +50,6 @@ Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_NAMESPACE", {
|
|
|
72
50
|
return MSTEAMS_DELEGATED_TOKEN_NAMESPACE;
|
|
73
51
|
}
|
|
74
52
|
});
|
|
75
|
-
Object.defineProperty(exports, "__toESM", {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function() {
|
|
78
|
-
return __toESM;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
53
|
Object.defineProperty(exports, "loadMSTeamsDelegatedTokens", {
|
|
82
54
|
enumerable: true,
|
|
83
55
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
2
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CEj9sABO.cjs");
|
|
3
3
|
let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
|
|
4
4
|
const msteamsDirectoryContractPlugin = {
|
|
5
5
|
id: "msteams",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const require_sso_token_store = require("./sso-token-store-
|
|
2
|
+
const require_polls = require("./polls-BWKNpBSg.cjs");
|
|
3
|
+
const require_delegated_state = require("./delegated-state-DiEz9JIa.cjs");
|
|
4
|
+
const require_sso_token_store = require("./sso-token-store-TKYk_Ms7.cjs");
|
|
5
5
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
6
6
|
let node_crypto = require("node:crypto");
|
|
7
|
-
node_crypto =
|
|
7
|
+
node_crypto = require_polls.__toESM(node_crypto, 1);
|
|
8
8
|
let node_fs_promises = require("node:fs/promises");
|
|
9
|
-
node_fs_promises =
|
|
9
|
+
node_fs_promises = require_polls.__toESM(node_fs_promises, 1);
|
|
10
10
|
let node_path = require("node:path");
|
|
11
|
-
node_path =
|
|
11
|
+
node_path = require_polls.__toESM(node_path, 1);
|
|
12
12
|
let openclaw_plugin_sdk_runtime_doctor = require("openclaw/plugin-sdk/runtime-doctor");
|
|
13
13
|
let openclaw_plugin_sdk_session_store_runtime = require("openclaw/plugin-sdk/session-store-runtime");
|
|
14
14
|
//#region extensions/msteams/doctor-contract-api.ts
|
|
@@ -60,12 +60,14 @@ function resolveLegacySanitizedSessionKey(fileStem, knownSessionKeys) {
|
|
|
60
60
|
}
|
|
61
61
|
function listAgentIds(config) {
|
|
62
62
|
const ids = /* @__PURE__ */ new Set(["main"]);
|
|
63
|
+
if ((0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(config.agents?.entries)) {
|
|
64
|
+
for (const agentId of Object.keys(config.agents.entries)) if (agentId.trim()) ids.add(agentId.trim());
|
|
65
|
+
}
|
|
63
66
|
for (const agent of config.agents?.list ?? []) if (typeof agent.id === "string" && agent.id.trim()) ids.add(agent.id.trim());
|
|
64
67
|
return [...ids];
|
|
65
68
|
}
|
|
66
69
|
function listCandidateStorePaths(params) {
|
|
67
70
|
const paths = /* @__PURE__ */ new Set();
|
|
68
|
-
paths.add((0, openclaw_plugin_sdk_session_store_runtime.resolveStorePath)(params.config.session?.store, { env: params.env }));
|
|
69
71
|
for (const agentId of listAgentIds(params.config)) paths.add((0, openclaw_plugin_sdk_session_store_runtime.resolveStorePath)(params.config.session?.store, {
|
|
70
72
|
agentId,
|
|
71
73
|
env: params.env
|