@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.
Files changed (32) hide show
  1. package/dist/.setup/{adapter.runtime-BMvpm7sS.cjs → adapter.runtime-UOD_H_ph.cjs} +20 -23
  2. package/dist/.setup/{approval-card-Bo8kHYbj.cjs → approval-card-CD5q0Nla.cjs} +5 -9
  3. package/dist/.setup/{approval-handler.runtime-BS3avHFu.cjs → approval-handler.runtime-DbPxvynk.cjs} +4 -4
  4. package/dist/.setup/{channel-CdCSk3Rg.cjs → channel-DQrXOfhf.cjs} +24 -224
  5. package/dist/.setup/{channel.runtime--ZjTYgkY.cjs → channel.runtime-Du4GPMES.cjs} +65 -106
  6. package/dist/.setup/{channel.setup-nSTtK77J.cjs → channel.setup--7ko_Kxv.cjs} +161 -262
  7. package/dist/.setup/{config-schema-Bm15lF-j.cjs → config-schema-BEXDIOC-.cjs} +120 -123
  8. package/dist/.setup/{conversation-store-state-NJU9osd-.cjs → conversation-store-state-AVgRyNE9.cjs} +411 -598
  9. package/dist/.setup/{delegated-state-CbMd3rIh.cjs → delegated-state-DhIHahf1.cjs} +68 -6
  10. package/dist/.setup/{monitor-BxLDs5fk.cjs → monitor-CXjIKz7o.cjs} +1883 -2284
  11. package/dist/.setup/{oauth-B-Y5pNM4.cjs → oauth-BWG6qWCd.cjs} +10 -20
  12. package/dist/.setup/presentation-CaLawc5j.cjs +211 -0
  13. package/dist/.setup/{reaction-types-BaL1EVBS.cjs → reaction-types-DOzN5oTl.cjs} +1 -1
  14. package/dist/.setup/{resolve-allowlist-CqNzS9bZ.cjs → resolve-allowlist-Drj1jaq0.cjs} +213 -90
  15. package/dist/.setup/{secret-contract-api-BOzdWSn9.cjs → secret-contract-api-DFqDvc_a.cjs} +4 -6
  16. package/dist/.setup/{secret-contract-api-5aH1Fl_c.cjs → secret-contract-api-YGHrfAT0.cjs} +1 -1
  17. package/dist/.setup/{send-BXjI3ufq.cjs → send-BRUztzVJ.cjs} +86 -182
  18. package/dist/.setup/{setup-plugin-api-lPpin6Gg.cjs → setup-plugin-api-BHEfter5.cjs} +1 -1
  19. package/dist/.setup/{thread-session-DZMoCsSR.cjs → thread-session-BUUV1zk_.cjs} +4 -6
  20. package/dist/.setup/{token-config-DTZ00Ibq.cjs → token-config-7K6UbNCo.cjs} +0 -2
  21. package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -1
  22. package/dist/api.cjs +2 -2
  23. package/dist/channel-config-api.cjs +1 -1
  24. package/dist/channel-plugin-api.cjs +1 -1
  25. package/dist/directory-contract-api.cjs +1 -1
  26. package/dist/doctor-contract-api.cjs +6 -13
  27. package/dist/qa-runner-api.cjs +1 -1
  28. package/dist/secret-contract-api.cjs +1 -1
  29. package/dist/setup-entry.cjs +2 -2
  30. package/dist/setup-plugin-api.cjs +1 -1
  31. package/openclaw.plugin.json +0 -30
  32. package/package.json +11 -11
@@ -1,20 +1,6 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.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
- // 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
4
  // extensions/msteams/src/oauth.ts
19
5
  async function loginMSTeamsDelegated(ctx, params) {
20
6
  await ctx.note([
@@ -24,13 +10,17 @@ async function loginMSTeamsDelegated(ctx, params) {
24
10
  ].join("\n"), "MSTeams Delegated OAuth");
25
11
  const { verifier, challenge } = (0, openclaw_plugin_sdk_provider_auth.generateHexPkceVerifierChallenge)();
26
12
  const state = (0, openclaw_plugin_sdk_provider_auth_runtime.generateOAuthState)();
27
- const authUrl = buildMSTeamsAuthUrl({
28
- tenantId: params.tenantId,
29
- clientId: params.clientId,
30
- challenge,
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",
31
20
  state,
32
- scopes: require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES
21
+ prompt: "consent"
33
22
  });
23
+ const authUrl = `${require_resolve_allowlist.buildMSTeamsAuthEndpoint(params.tenantId)}?${query.toString()}`;
34
24
  ctx.progress.update("OAuth URL ready");
35
25
  ctx.log(`\nOpen this URL in your LOCAL browser:\n\n${authUrl}\n`);
36
26
  ctx.progress.update("Waiting for you to paste the callback URL...");
@@ -0,0 +1,211 @@
1
+ const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.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
+ // 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
+ // extensions/msteams/src/presentation.ts
89
+ const MSTEAMS_PRESENTATION_CAPABILITIES = {
90
+ supported: true,
91
+ buttons: true,
92
+ selects: false,
93
+ context: true,
94
+ divider: true,
95
+ limits: {
96
+ actions: {
97
+ supportsStyles: false,
98
+ supportsDisabled: false
99
+ },
100
+ text: { markdownDialect: "markdown" }
101
+ }
102
+ };
103
+ function buildMSTeamsPresentationCard(params) {
104
+ const body = [];
105
+ const text = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.text);
106
+ if (text) body.push({
107
+ type: "TextBlock",
108
+ text,
109
+ wrap: true
110
+ });
111
+ const presentation = (0, openclaw_plugin_sdk_interactive_runtime.adaptMessagePresentationForChannel)({
112
+ presentation: params.presentation,
113
+ capabilities: MSTEAMS_PRESENTATION_CAPABILITIES
114
+ });
115
+ if (presentation.title) body.push({
116
+ type: "TextBlock",
117
+ text: presentation.title,
118
+ weight: "Bolder",
119
+ size: "Medium",
120
+ wrap: true
121
+ });
122
+ const actions = [];
123
+ for (const block of presentation.blocks) {
124
+ if (block.type === "text" || block.type === "context") {
125
+ body.push({
126
+ type: "TextBlock",
127
+ text: block.text,
128
+ wrap: true,
129
+ ...block.type === "context" ? {
130
+ isSubtle: true,
131
+ size: "Small"
132
+ } : {}
133
+ });
134
+ continue;
135
+ }
136
+ if (block.type === "divider") {
137
+ body.push({
138
+ type: "TextBlock",
139
+ text: "---",
140
+ wrap: true,
141
+ isSubtle: true
142
+ });
143
+ continue;
144
+ }
145
+ if (block.type === "buttons") for (const button of block.buttons) {
146
+ const action = (0, openclaw_plugin_sdk_interactive_runtime.resolveMessagePresentationButtonAction)(button);
147
+ if (action?.type === "url" || action?.type === "web-app") {
148
+ const url = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(action.url);
149
+ if (!url) continue;
150
+ actions.push({
151
+ type: "Action.OpenUrl",
152
+ title: button.label,
153
+ url
154
+ });
155
+ continue;
156
+ }
157
+ if (action?.type === "command") {
158
+ actions.push({
159
+ type: "Action.Submit",
160
+ title: button.label,
161
+ data: action.command
162
+ });
163
+ continue;
164
+ }
165
+ if (action?.type === "callback") actions.push({
166
+ type: "Action.Submit",
167
+ title: button.label,
168
+ data: {
169
+ value: action.value,
170
+ label: button.label
171
+ }
172
+ });
173
+ }
174
+ }
175
+ return {
176
+ type: "AdaptiveCard",
177
+ version: "1.4",
178
+ body,
179
+ ...actions.length ? { actions } : {}
180
+ };
181
+ }
182
+ Object.defineProperty(exports, "MSTEAMS_PRESENTATION_CAPABILITIES", {
183
+ enumerable: true,
184
+ get: function() {
185
+ return MSTEAMS_PRESENTATION_CAPABILITIES;
186
+ }
187
+ });
188
+ Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
189
+ enumerable: true,
190
+ get: function() {
191
+ return buildMSTeamsPresentationCard;
192
+ }
193
+ });
194
+ Object.defineProperty(exports, "resolveMSTeamsGroupToolPolicy", {
195
+ enumerable: true,
196
+ get: function() {
197
+ return resolveMSTeamsGroupToolPolicy;
198
+ }
199
+ });
200
+ Object.defineProperty(exports, "resolveMSTeamsReplyPolicy", {
201
+ enumerable: true,
202
+ get: function() {
203
+ return resolveMSTeamsReplyPolicy;
204
+ }
205
+ });
206
+ Object.defineProperty(exports, "resolveMSTeamsRouteConfig", {
207
+ enumerable: true,
208
+ get: function() {
209
+ return resolveMSTeamsRouteConfig;
210
+ }
211
+ });
@@ -1,4 +1,4 @@
1
- const require_resolve_allowlist = require("./resolve-allowlist-CqNzS9bZ.cjs");
1
+ const require_resolve_allowlist = require("./resolve-allowlist-Drj1jaq0.cjs");
2
2
  // 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;