@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.
- package/dist/.setup/{adapter.runtime-B-6Q3nMI.cjs → adapter.runtime-BB38Rdj_.cjs} +20 -23
- package/dist/.setup/{approval-card-DWPDItvq.cjs → approval-card-BHAKsdAM.cjs} +5 -9
- package/dist/.setup/{approval-handler.runtime-D0jbDypb.cjs → approval-handler.runtime-C16UvawQ.cjs} +4 -4
- package/dist/.setup/{channel-Ci6K9Njb.cjs → channel-BaTw0JW3.cjs} +35 -254
- package/dist/.setup/{channel.runtime-DeHVAVxL.cjs → channel.runtime-Ch2M_-jN.cjs} +65 -107
- package/dist/.setup/{channel.setup-BN3uhq3r.cjs → channel.setup-B9yKGEse.cjs} +161 -262
- package/dist/.setup/{config-schema-CkKdphSp.cjs → config-schema-3lVZ45cB.cjs} +120 -125
- package/dist/.setup/{conversation-store-state-B-4g4uq5.cjs → conversation-store-state-CVhMM0QY.cjs} +411 -601
- package/dist/.setup/{delegated-state-Bv5cWuec.cjs → delegated-state-ilYzKwD8.cjs} +68 -6
- package/dist/.setup/{monitor-cuifGELM.cjs → monitor-b0zPpnmW.cjs} +1883 -2310
- package/dist/.setup/{oauth-BBUQCwmq.cjs → oauth-CUtfkgKE.cjs} +10 -21
- package/dist/.setup/presentation-Duoi9Ijn.cjs +213 -0
- package/dist/.setup/{reaction-types-CwP5RVQB.cjs → reaction-types-C6F6g2nk.cjs} +1 -1
- package/dist/.setup/{resolve-allowlist-gI34MnpE.cjs → resolve-allowlist-7mIEepXB.cjs} +214 -90
- package/dist/.setup/{secret-contract-api-wAyY5UHv.cjs → secret-contract-api-D554HIrH.cjs} +4 -6
- package/dist/.setup/{secret-contract-api-YY3v6MP8.cjs → secret-contract-api-r3hRtbBW.cjs} +1 -1
- package/dist/.setup/{send-C9JY42T6.cjs → send-D1w7a_ip.cjs} +86 -182
- package/dist/.setup/{setup-plugin-api-B-NYBLkF.cjs → setup-plugin-api-ChovZJU6.cjs} +1 -1
- package/dist/.setup/{thread-session-BWVCoYza.cjs → thread-session-CeWYiol_.cjs} +4 -6
- package/dist/.setup/{token-config-bEpua_Q7.cjs → token-config-DICiuJWr.cjs} +0 -2
- package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -0
- 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 +3 -11
- 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,21 +1,6 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
2
2
|
let openclaw_plugin_sdk_provider_auth = require("openclaw/plugin-sdk/provider-auth");
|
|
3
3
|
let openclaw_plugin_sdk_provider_auth_runtime = require("openclaw/plugin-sdk/provider-auth-runtime");
|
|
4
|
-
//#region extensions/msteams/src/oauth.flow.ts
|
|
5
|
-
function buildMSTeamsAuthUrl(params) {
|
|
6
|
-
const scopes = params.scopes ?? require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
7
|
-
return `${require_resolve_allowlist.buildMSTeamsAuthEndpoint(params.tenantId)}?${new URLSearchParams({
|
|
8
|
-
client_id: params.clientId,
|
|
9
|
-
response_type: "code",
|
|
10
|
-
redirect_uri: require_resolve_allowlist.MSTEAMS_OAUTH_REDIRECT_URI,
|
|
11
|
-
scope: scopes.join(" "),
|
|
12
|
-
code_challenge: params.challenge,
|
|
13
|
-
code_challenge_method: "S256",
|
|
14
|
-
state: params.state,
|
|
15
|
-
prompt: "consent"
|
|
16
|
-
}).toString()}`;
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
4
|
//#region extensions/msteams/src/oauth.ts
|
|
20
5
|
async function loginMSTeamsDelegated(ctx, params) {
|
|
21
6
|
await ctx.note([
|
|
@@ -25,13 +10,17 @@ async function loginMSTeamsDelegated(ctx, params) {
|
|
|
25
10
|
].join("\n"), "MSTeams Delegated OAuth");
|
|
26
11
|
const { verifier, challenge } = (0, openclaw_plugin_sdk_provider_auth.generateHexPkceVerifierChallenge)();
|
|
27
12
|
const state = (0, openclaw_plugin_sdk_provider_auth_runtime.generateOAuthState)();
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
13
|
+
const query = new URLSearchParams({
|
|
14
|
+
client_id: params.clientId,
|
|
15
|
+
response_type: "code",
|
|
16
|
+
redirect_uri: require_resolve_allowlist.MSTEAMS_OAUTH_REDIRECT_URI,
|
|
17
|
+
scope: require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES.join(" "),
|
|
18
|
+
code_challenge: challenge,
|
|
19
|
+
code_challenge_method: "S256",
|
|
32
20
|
state,
|
|
33
|
-
|
|
21
|
+
prompt: "consent"
|
|
34
22
|
});
|
|
23
|
+
const authUrl = `${require_resolve_allowlist.buildMSTeamsAuthEndpoint(params.tenantId)}?${query.toString()}`;
|
|
35
24
|
ctx.progress.update("OAuth URL ready");
|
|
36
25
|
ctx.log(`\nOpen this URL in your LOCAL browser:\n\n${authUrl}\n`);
|
|
37
26
|
ctx.progress.update("Waiting for you to paste the callback URL...");
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
2
|
+
require("../runtime-api.cjs");
|
|
3
|
+
let openclaw_plugin_sdk_channel_policy = require("openclaw/plugin-sdk/channel-policy");
|
|
4
|
+
let openclaw_plugin_sdk_interactive_runtime = require("openclaw/plugin-sdk/interactive-runtime");
|
|
5
|
+
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
6
|
+
let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
|
|
7
|
+
//#region extensions/msteams/src/policy.ts
|
|
8
|
+
function matchMSTeamsPolicyEntry(entries, ...keys) {
|
|
9
|
+
return (0, openclaw_plugin_sdk_channel_targets.resolveChannelEntryMatchWithFallback)({
|
|
10
|
+
entries,
|
|
11
|
+
keys: (0, openclaw_plugin_sdk_channel_targets.buildChannelKeyCandidates)(...keys),
|
|
12
|
+
wildcardKey: "*",
|
|
13
|
+
normalizeKey: openclaw_plugin_sdk_channel_targets.normalizeChannelSlug
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function selectMSTeamsPolicyEntry(entries, key) {
|
|
17
|
+
const match = matchMSTeamsPolicyEntry(entries, key?.trim());
|
|
18
|
+
return match.matchKey ?? match.key ? match.entry : void 0;
|
|
19
|
+
}
|
|
20
|
+
function resolveMSTeamsRouteConfig(params) {
|
|
21
|
+
const teamId = params.teamId?.trim();
|
|
22
|
+
const teamName = params.teamName?.trim();
|
|
23
|
+
const conversationId = params.conversationId?.trim();
|
|
24
|
+
const channelName = params.channelName?.trim();
|
|
25
|
+
const teams = params.cfg?.teams ?? {};
|
|
26
|
+
const allowlistConfigured = Object.keys(teams).length > 0;
|
|
27
|
+
const teamMatch = matchMSTeamsPolicyEntry(teams, teamId, params.allowNameMatching ? teamName : void 0, params.allowNameMatching && teamName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(teamName) : void 0);
|
|
28
|
+
const teamConfig = teamMatch.entry;
|
|
29
|
+
const channels = teamConfig?.channels ?? {};
|
|
30
|
+
const channelAllowlistConfigured = Object.keys(channels).length > 0;
|
|
31
|
+
const channelMatch = matchMSTeamsPolicyEntry(channels, conversationId, params.allowNameMatching ? channelName : void 0, params.allowNameMatching && channelName ? (0, openclaw_plugin_sdk_channel_targets.normalizeChannelSlug)(channelName) : void 0);
|
|
32
|
+
const channelConfig = channelMatch.entry;
|
|
33
|
+
return {
|
|
34
|
+
teamConfig,
|
|
35
|
+
channelConfig,
|
|
36
|
+
allowlistConfigured,
|
|
37
|
+
allowed: (0, openclaw_plugin_sdk_channel_targets.resolveNestedAllowlistDecision)({
|
|
38
|
+
outerConfigured: allowlistConfigured,
|
|
39
|
+
outerMatched: Boolean(teamConfig),
|
|
40
|
+
innerConfigured: channelAllowlistConfigured,
|
|
41
|
+
innerMatched: Boolean(channelConfig)
|
|
42
|
+
}),
|
|
43
|
+
teamKey: teamMatch.matchKey ?? teamMatch.key,
|
|
44
|
+
channelKey: channelMatch.matchKey ?? channelMatch.key,
|
|
45
|
+
channelMatchKey: channelMatch.matchKey,
|
|
46
|
+
channelMatchSource: channelMatch.matchSource === "direct" || channelMatch.matchSource === "wildcard" ? channelMatch.matchSource : void 0
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function resolveMSTeamsGroupToolPolicy(params) {
|
|
50
|
+
const cfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(params.cfg, params.accountId);
|
|
51
|
+
if (!cfg) return;
|
|
52
|
+
const teams = cfg.teams ?? {};
|
|
53
|
+
const team = selectMSTeamsPolicyEntry(teams, params.groupSpace);
|
|
54
|
+
const channel = team && selectMSTeamsPolicyEntry(team.channels ?? {}, params.groupId);
|
|
55
|
+
const resolve = (selectedTeam, selectedChannel) => (0, openclaw_plugin_sdk_channel_policy.resolveScopeToolsPolicy)({
|
|
56
|
+
tree: { scopes: {
|
|
57
|
+
team: selectedTeam ?? {},
|
|
58
|
+
channel: selectedChannel ?? {}
|
|
59
|
+
} },
|
|
60
|
+
path: ["team", "channel"],
|
|
61
|
+
senderPolicyMode: params.senderPolicyMode,
|
|
62
|
+
senderId: params.senderId,
|
|
63
|
+
senderName: params.senderName,
|
|
64
|
+
senderUsername: params.senderUsername,
|
|
65
|
+
senderE164: params.senderE164
|
|
66
|
+
});
|
|
67
|
+
const resolved = resolve(team, channel);
|
|
68
|
+
if (resolved !== void 0 || channel) return resolved;
|
|
69
|
+
if (params.groupId?.trim()) for (const candidate of Object.values(teams)) {
|
|
70
|
+
const matched = selectMSTeamsPolicyEntry(candidate.channels ?? {}, params.groupId);
|
|
71
|
+
if (matched) return resolve(candidate, matched);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function resolveMSTeamsReplyPolicy(params) {
|
|
75
|
+
if (params.isDirectMessage) return {
|
|
76
|
+
requireMention: false,
|
|
77
|
+
replyStyle: "thread"
|
|
78
|
+
};
|
|
79
|
+
const requireMention = params.channelConfig?.requireMention ?? params.teamConfig?.requireMention ?? params.globalConfig?.requireMention ?? true;
|
|
80
|
+
const explicitReplyStyle = params.channelConfig?.replyStyle ?? params.teamConfig?.replyStyle ?? params.globalConfig?.replyStyle;
|
|
81
|
+
const requireMentionInBotThreads = params.channelConfig?.requireMentionInBotThreads ?? params.teamConfig?.requireMentionInBotThreads ?? params.globalConfig?.requireMentionInBotThreads;
|
|
82
|
+
return {
|
|
83
|
+
requireMention,
|
|
84
|
+
replyStyle: explicitReplyStyle ?? (requireMention ? "thread" : "top-level"),
|
|
85
|
+
...requireMentionInBotThreads === void 0 ? {} : { requireMentionInBotThreads }
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region extensions/msteams/src/presentation.ts
|
|
90
|
+
const MSTEAMS_PRESENTATION_CAPABILITIES = {
|
|
91
|
+
supported: true,
|
|
92
|
+
buttons: true,
|
|
93
|
+
selects: false,
|
|
94
|
+
context: true,
|
|
95
|
+
divider: true,
|
|
96
|
+
limits: {
|
|
97
|
+
actions: {
|
|
98
|
+
supportsStyles: false,
|
|
99
|
+
supportsDisabled: false
|
|
100
|
+
},
|
|
101
|
+
text: { markdownDialect: "markdown" }
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
function buildMSTeamsPresentationCard(params) {
|
|
105
|
+
const body = [];
|
|
106
|
+
const text = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.text);
|
|
107
|
+
if (text) body.push({
|
|
108
|
+
type: "TextBlock",
|
|
109
|
+
text,
|
|
110
|
+
wrap: true
|
|
111
|
+
});
|
|
112
|
+
const presentation = (0, openclaw_plugin_sdk_interactive_runtime.adaptMessagePresentationForChannel)({
|
|
113
|
+
presentation: params.presentation,
|
|
114
|
+
capabilities: MSTEAMS_PRESENTATION_CAPABILITIES
|
|
115
|
+
});
|
|
116
|
+
if (presentation.title) body.push({
|
|
117
|
+
type: "TextBlock",
|
|
118
|
+
text: presentation.title,
|
|
119
|
+
weight: "Bolder",
|
|
120
|
+
size: "Medium",
|
|
121
|
+
wrap: true
|
|
122
|
+
});
|
|
123
|
+
const actions = [];
|
|
124
|
+
for (const block of presentation.blocks) {
|
|
125
|
+
if (block.type === "text" || block.type === "context") {
|
|
126
|
+
body.push({
|
|
127
|
+
type: "TextBlock",
|
|
128
|
+
text: block.text,
|
|
129
|
+
wrap: true,
|
|
130
|
+
...block.type === "context" ? {
|
|
131
|
+
isSubtle: true,
|
|
132
|
+
size: "Small"
|
|
133
|
+
} : {}
|
|
134
|
+
});
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (block.type === "divider") {
|
|
138
|
+
body.push({
|
|
139
|
+
type: "TextBlock",
|
|
140
|
+
text: "---",
|
|
141
|
+
wrap: true,
|
|
142
|
+
isSubtle: true
|
|
143
|
+
});
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (block.type === "buttons") for (const button of block.buttons) {
|
|
147
|
+
const action = (0, openclaw_plugin_sdk_interactive_runtime.resolveMessagePresentationButtonAction)(button);
|
|
148
|
+
if (action?.type === "url" || action?.type === "web-app") {
|
|
149
|
+
const url = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(action.url);
|
|
150
|
+
if (!url) continue;
|
|
151
|
+
actions.push({
|
|
152
|
+
type: "Action.OpenUrl",
|
|
153
|
+
title: button.label,
|
|
154
|
+
url
|
|
155
|
+
});
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (action?.type === "command") {
|
|
159
|
+
actions.push({
|
|
160
|
+
type: "Action.Submit",
|
|
161
|
+
title: button.label,
|
|
162
|
+
data: action.command
|
|
163
|
+
});
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (action?.type === "callback") actions.push({
|
|
167
|
+
type: "Action.Submit",
|
|
168
|
+
title: button.label,
|
|
169
|
+
data: {
|
|
170
|
+
value: action.value,
|
|
171
|
+
label: button.label
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
type: "AdaptiveCard",
|
|
178
|
+
version: "1.4",
|
|
179
|
+
body,
|
|
180
|
+
...actions.length ? { actions } : {}
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
Object.defineProperty(exports, "MSTEAMS_PRESENTATION_CAPABILITIES", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
get: function() {
|
|
187
|
+
return MSTEAMS_PRESENTATION_CAPABILITIES;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function() {
|
|
193
|
+
return buildMSTeamsPresentationCard;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(exports, "resolveMSTeamsGroupToolPolicy", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function() {
|
|
199
|
+
return resolveMSTeamsGroupToolPolicy;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "resolveMSTeamsReplyPolicy", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function() {
|
|
205
|
+
return resolveMSTeamsReplyPolicy;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "resolveMSTeamsRouteConfig", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function() {
|
|
211
|
+
return resolveMSTeamsRouteConfig;
|
|
212
|
+
}
|
|
213
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
2
2
|
//#region extensions/msteams/src/graph-thread.ts
|
|
3
3
|
/** Keep inbound thread enrichment bounded while still reaching recent replies. */
|
|
4
4
|
const MAX_REPLY_PAGES = 50;
|