@openclaw/msteams 2026.5.2-beta.2 → 2026.5.3-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/api.js +3 -0
- package/dist/channel-D7hdreTh.js +984 -0
- package/dist/channel-config-api.js +2 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.runtime-BC1ruIfN.js +573 -0
- package/dist/config-schema-B8QezH6t.js +15 -0
- package/dist/contract-api.js +2 -0
- package/dist/graph-users-9uQJepqr.js +1354 -0
- package/dist/index.js +22 -0
- package/dist/oauth-BWJyilR1.js +114 -0
- package/dist/oauth.token-xxpoLWy5.js +115 -0
- package/dist/policy-DTnU2GR7.js +142 -0
- package/dist/probe-D_H8yFps.js +2194 -0
- package/dist/resolve-allowlist-D41JSziq.js +219 -0
- package/dist/runtime-api-DV1iVMn1.js +28 -0
- package/dist/runtime-api.js +2 -0
- package/dist/secret-contract-BuoEXmPS.js +35 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/setup-entry.js +15 -0
- package/dist/setup-plugin-api.js +64 -0
- package/dist/setup-surface-BLkFQYIQ.js +313 -0
- package/dist/src-CFp1QpFd.js +4064 -0
- package/dist/test-api.js +2 -0
- package/package.json +14 -6
- package/api.ts +0 -3
- package/channel-config-api.ts +0 -1
- package/channel-plugin-api.ts +0 -2
- package/config-api.ts +0 -4
- package/contract-api.ts +0 -4
- package/index.ts +0 -20
- package/runtime-api.ts +0 -73
- package/secret-contract-api.ts +0 -5
- package/setup-entry.ts +0 -13
- package/setup-plugin-api.ts +0 -3
- package/src/ai-entity.ts +0 -7
- package/src/approval-auth.ts +0 -44
- package/src/attachments/bot-framework.test.ts +0 -461
- package/src/attachments/bot-framework.ts +0 -362
- package/src/attachments/download.ts +0 -311
- package/src/attachments/graph.test.ts +0 -416
- package/src/attachments/graph.ts +0 -484
- package/src/attachments/html.ts +0 -122
- package/src/attachments/payload.ts +0 -14
- package/src/attachments/remote-media.test.ts +0 -137
- package/src/attachments/remote-media.ts +0 -112
- package/src/attachments/shared.test.ts +0 -530
- package/src/attachments/shared.ts +0 -626
- package/src/attachments/types.ts +0 -47
- package/src/attachments.graph.test.ts +0 -342
- package/src/attachments.helpers.test.ts +0 -246
- package/src/attachments.test-helpers.ts +0 -17
- package/src/attachments.test.ts +0 -687
- package/src/attachments.ts +0 -18
- package/src/block-streaming-config.test.ts +0 -61
- package/src/channel-api.ts +0 -1
- package/src/channel.actions.test.ts +0 -742
- package/src/channel.directory.test.ts +0 -200
- package/src/channel.runtime.ts +0 -56
- package/src/channel.setup.ts +0 -77
- package/src/channel.test.ts +0 -128
- package/src/channel.ts +0 -1136
- package/src/config-schema.ts +0 -6
- package/src/config-ui-hints.ts +0 -12
- package/src/conversation-store-fs.test.ts +0 -74
- package/src/conversation-store-fs.ts +0 -149
- package/src/conversation-store-helpers.test.ts +0 -202
- package/src/conversation-store-helpers.ts +0 -105
- package/src/conversation-store-memory.ts +0 -51
- package/src/conversation-store.shared.test.ts +0 -225
- package/src/conversation-store.ts +0 -71
- package/src/directory-live.test.ts +0 -156
- package/src/directory-live.ts +0 -111
- package/src/doctor.ts +0 -27
- package/src/errors.test.ts +0 -133
- package/src/errors.ts +0 -246
- package/src/feedback-reflection-prompt.ts +0 -117
- package/src/feedback-reflection-store.ts +0 -114
- package/src/feedback-reflection.test.ts +0 -237
- package/src/feedback-reflection.ts +0 -283
- package/src/file-consent-helpers.test.ts +0 -326
- package/src/file-consent-helpers.ts +0 -126
- package/src/file-consent-invoke.ts +0 -150
- package/src/file-consent.test.ts +0 -363
- package/src/file-consent.ts +0 -287
- package/src/graph-chat.ts +0 -55
- package/src/graph-group-management.test.ts +0 -318
- package/src/graph-group-management.ts +0 -168
- package/src/graph-members.test.ts +0 -89
- package/src/graph-members.ts +0 -48
- package/src/graph-messages.actions.test.ts +0 -243
- package/src/graph-messages.read.test.ts +0 -391
- package/src/graph-messages.search.test.ts +0 -213
- package/src/graph-messages.test-helpers.ts +0 -50
- package/src/graph-messages.ts +0 -534
- package/src/graph-teams.test.ts +0 -215
- package/src/graph-teams.ts +0 -114
- package/src/graph-thread.test.ts +0 -246
- package/src/graph-thread.ts +0 -146
- package/src/graph-upload.test.ts +0 -258
- package/src/graph-upload.ts +0 -531
- package/src/graph-users.ts +0 -29
- package/src/graph.test.ts +0 -516
- package/src/graph.ts +0 -293
- package/src/inbound.test.ts +0 -221
- package/src/inbound.ts +0 -148
- package/src/index.ts +0 -4
- package/src/media-helpers.test.ts +0 -202
- package/src/media-helpers.ts +0 -105
- package/src/mentions.test.ts +0 -244
- package/src/mentions.ts +0 -114
- package/src/messenger.test.ts +0 -865
- package/src/messenger.ts +0 -605
- package/src/monitor-handler/access.ts +0 -125
- package/src/monitor-handler/inbound-media.test.ts +0 -289
- package/src/monitor-handler/inbound-media.ts +0 -180
- package/src/monitor-handler/message-handler-mock-support.test-support.ts +0 -28
- package/src/monitor-handler/message-handler.authz.test.ts +0 -669
- package/src/monitor-handler/message-handler.dm-media.test.ts +0 -54
- package/src/monitor-handler/message-handler.test-support.ts +0 -100
- package/src/monitor-handler/message-handler.thread-parent.test.ts +0 -223
- package/src/monitor-handler/message-handler.thread-session.test.ts +0 -77
- package/src/monitor-handler/message-handler.ts +0 -1000
- package/src/monitor-handler/reaction-handler.test.ts +0 -267
- package/src/monitor-handler/reaction-handler.ts +0 -210
- package/src/monitor-handler/thread-session.ts +0 -17
- package/src/monitor-handler.adaptive-card.test.ts +0 -162
- package/src/monitor-handler.feedback-authz.test.ts +0 -314
- package/src/monitor-handler.file-consent.test.ts +0 -423
- package/src/monitor-handler.sso.test.ts +0 -563
- package/src/monitor-handler.test-helpers.ts +0 -180
- package/src/monitor-handler.ts +0 -534
- package/src/monitor-handler.types.ts +0 -27
- package/src/monitor-types.ts +0 -6
- package/src/monitor.lifecycle.test.ts +0 -278
- package/src/monitor.test.ts +0 -119
- package/src/monitor.ts +0 -442
- package/src/oauth.flow.ts +0 -77
- package/src/oauth.shared.ts +0 -37
- package/src/oauth.test.ts +0 -305
- package/src/oauth.token.ts +0 -158
- package/src/oauth.ts +0 -130
- package/src/outbound.test.ts +0 -130
- package/src/outbound.ts +0 -71
- package/src/pending-uploads-fs.test.ts +0 -246
- package/src/pending-uploads-fs.ts +0 -235
- package/src/pending-uploads.test.ts +0 -173
- package/src/pending-uploads.ts +0 -121
- package/src/policy.test.ts +0 -240
- package/src/policy.ts +0 -262
- package/src/polls-store-memory.ts +0 -32
- package/src/polls.test.ts +0 -160
- package/src/polls.ts +0 -323
- package/src/presentation.ts +0 -68
- package/src/probe.test.ts +0 -77
- package/src/probe.ts +0 -132
- package/src/reply-dispatcher.test.ts +0 -437
- package/src/reply-dispatcher.ts +0 -346
- package/src/reply-stream-controller.test.ts +0 -235
- package/src/reply-stream-controller.ts +0 -147
- package/src/resolve-allowlist.test.ts +0 -250
- package/src/resolve-allowlist.ts +0 -309
- package/src/revoked-context.ts +0 -17
- package/src/runtime.ts +0 -9
- package/src/sdk-types.ts +0 -59
- package/src/sdk.test.ts +0 -666
- package/src/sdk.ts +0 -884
- package/src/secret-contract.ts +0 -49
- package/src/secret-input.ts +0 -7
- package/src/send-context.ts +0 -231
- package/src/send.test.ts +0 -493
- package/src/send.ts +0 -637
- package/src/sent-message-cache.test.ts +0 -15
- package/src/sent-message-cache.ts +0 -56
- package/src/session-route.ts +0 -40
- package/src/setup-core.ts +0 -160
- package/src/setup-surface.test.ts +0 -202
- package/src/setup-surface.ts +0 -320
- package/src/sso-token-store.test.ts +0 -72
- package/src/sso-token-store.ts +0 -166
- package/src/sso.ts +0 -300
- package/src/storage.ts +0 -25
- package/src/store-fs.ts +0 -44
- package/src/streaming-message.test.ts +0 -262
- package/src/streaming-message.ts +0 -297
- package/src/test-runtime.ts +0 -16
- package/src/thread-parent-context.test.ts +0 -224
- package/src/thread-parent-context.ts +0 -159
- package/src/token-response.ts +0 -11
- package/src/token.test.ts +0 -259
- package/src/token.ts +0 -195
- package/src/user-agent.test.ts +0 -86
- package/src/user-agent.ts +0 -53
- package/src/webhook-timeouts.ts +0 -27
- package/src/welcome-card.test.ts +0 -81
- package/src/welcome-card.ts +0 -57
- package/test-api.ts +0 -1
- package/tsconfig.json +0 -16
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { c as normalizeQuery, f as resolveGraphToken, o as listChannelsForTeam, s as listTeamsByName, t as searchGraphUsers } from "./graph-users-9uQJepqr.js";
|
|
2
|
+
import { mapAllowlistResolutionInputs } from "openclaw/plugin-sdk/allow-from";
|
|
3
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/text-runtime";
|
|
4
|
+
//#region extensions/msteams/src/resolve-allowlist.ts
|
|
5
|
+
function stripProviderPrefix(raw) {
|
|
6
|
+
return raw.replace(/^(msteams|teams):/i, "");
|
|
7
|
+
}
|
|
8
|
+
function normalizeMSTeamsMessagingTarget(raw) {
|
|
9
|
+
let trimmed = raw.trim();
|
|
10
|
+
if (!trimmed) return;
|
|
11
|
+
trimmed = stripProviderPrefix(trimmed).trim();
|
|
12
|
+
if (/^conversation:/i.test(trimmed)) {
|
|
13
|
+
const id = trimmed.slice(13).trim();
|
|
14
|
+
return id ? `conversation:${id}` : void 0;
|
|
15
|
+
}
|
|
16
|
+
if (/^user:/i.test(trimmed)) {
|
|
17
|
+
const id = trimmed.slice(5).trim();
|
|
18
|
+
return id ? `user:${id}` : void 0;
|
|
19
|
+
}
|
|
20
|
+
return trimmed || void 0;
|
|
21
|
+
}
|
|
22
|
+
function normalizeMSTeamsUserInput(raw) {
|
|
23
|
+
return stripProviderPrefix(raw).replace(/^(user|conversation):/i, "").trim();
|
|
24
|
+
}
|
|
25
|
+
function parseMSTeamsConversationId(raw) {
|
|
26
|
+
const trimmed = stripProviderPrefix(raw).trim();
|
|
27
|
+
if (!/^conversation:/i.test(trimmed)) return null;
|
|
28
|
+
return trimmed.slice(13).trim();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Detect whether a raw target string looks like a Microsoft Teams conversation
|
|
32
|
+
* or user id that cron announce delivery and other explicit-target paths can
|
|
33
|
+
* forward verbatim to the channel adapter.
|
|
34
|
+
*
|
|
35
|
+
* Accepts both prefixed and bare formats:
|
|
36
|
+
* - `conversation:<id>` — explicit conversation prefix
|
|
37
|
+
* - `user:<aad-guid>` — user id (16+ hex chars, UUID-like)
|
|
38
|
+
* - `19:abc@thread.tacv2` / `19:abc@thread.skype` — channel / legacy group
|
|
39
|
+
* - `19:{userId}_{appId}@unq.gbl.spaces` — Graph 1:1 chat thread format
|
|
40
|
+
* - `a:1xxx` — Bot Framework personal (1:1) chat id
|
|
41
|
+
* - `8:orgid:xxx` — Bot Framework org-scoped personal chat id
|
|
42
|
+
* - `29:xxx` — Bot Framework user id
|
|
43
|
+
*
|
|
44
|
+
* Display-name user targets such as `user:John Smith` intentionally return
|
|
45
|
+
* false so that the Graph API directory lookup still runs for them.
|
|
46
|
+
*/
|
|
47
|
+
function looksLikeMSTeamsTargetId(raw) {
|
|
48
|
+
const trimmed = raw.trim();
|
|
49
|
+
if (!trimmed) return false;
|
|
50
|
+
if (/^conversation:/i.test(trimmed)) return true;
|
|
51
|
+
if (/^user:/i.test(trimmed)) {
|
|
52
|
+
const id = trimmed.slice(5).trim();
|
|
53
|
+
return /^[0-9a-fA-F-]{16,}$/.test(id);
|
|
54
|
+
}
|
|
55
|
+
if (/^19:.+@thread\.(tacv2|skype)$/i.test(trimmed)) return true;
|
|
56
|
+
if (/^19:.+@unq\.gbl\.spaces$/i.test(trimmed)) return true;
|
|
57
|
+
if (/^a:1[A-Za-z0-9_-]+$/i.test(trimmed)) return true;
|
|
58
|
+
if (/^8:orgid:[A-Za-z0-9-]+$/i.test(trimmed)) return true;
|
|
59
|
+
if (/^29:[A-Za-z0-9_-]+$/i.test(trimmed)) return true;
|
|
60
|
+
return /@thread\b/i.test(trimmed);
|
|
61
|
+
}
|
|
62
|
+
function normalizeMSTeamsTeamKey(raw) {
|
|
63
|
+
return stripProviderPrefix(raw).replace(/^team:/i, "").trim() || void 0;
|
|
64
|
+
}
|
|
65
|
+
function normalizeMSTeamsChannelKey(raw) {
|
|
66
|
+
return (raw?.trim().replace(/^#/, "").trim() ?? "") || void 0;
|
|
67
|
+
}
|
|
68
|
+
function normalizeMSTeamsConversationTargetId(raw) {
|
|
69
|
+
const trimmed = stripProviderPrefix(raw).trim();
|
|
70
|
+
return parseMSTeamsConversationId(trimmed) ?? trimmed;
|
|
71
|
+
}
|
|
72
|
+
function looksLikeMSTeamsThreadConversationId(raw) {
|
|
73
|
+
const normalized = normalizeMSTeamsConversationTargetId(raw);
|
|
74
|
+
return /^19:.+@thread\./i.test(normalized);
|
|
75
|
+
}
|
|
76
|
+
function parseMSTeamsTeamChannelInput(raw) {
|
|
77
|
+
const trimmed = stripProviderPrefix(raw).trim();
|
|
78
|
+
if (!trimmed) return {};
|
|
79
|
+
const parts = trimmed.split("/");
|
|
80
|
+
const team = normalizeMSTeamsTeamKey(parts[0] ?? "");
|
|
81
|
+
const channel = parts.length > 1 ? normalizeMSTeamsChannelKey(parts.slice(1).join("/")) : void 0;
|
|
82
|
+
return {
|
|
83
|
+
...team ? { team } : {},
|
|
84
|
+
...channel ? { channel } : {}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function parseMSTeamsTeamEntry(raw) {
|
|
88
|
+
const { team, channel } = parseMSTeamsTeamChannelInput(raw);
|
|
89
|
+
if (!team) return null;
|
|
90
|
+
return {
|
|
91
|
+
teamKey: team,
|
|
92
|
+
...channel ? { channelKey: channel } : {}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
async function resolveMSTeamsChannelAllowlist(params) {
|
|
96
|
+
let tokenPromise;
|
|
97
|
+
const getToken = () => {
|
|
98
|
+
tokenPromise ??= resolveGraphToken(params.cfg);
|
|
99
|
+
return tokenPromise;
|
|
100
|
+
};
|
|
101
|
+
return await mapAllowlistResolutionInputs({
|
|
102
|
+
inputs: params.entries,
|
|
103
|
+
mapInput: async (input) => {
|
|
104
|
+
const { team, channel } = parseMSTeamsTeamChannelInput(input);
|
|
105
|
+
if (!team) return {
|
|
106
|
+
input,
|
|
107
|
+
resolved: false
|
|
108
|
+
};
|
|
109
|
+
if (looksLikeMSTeamsThreadConversationId(team)) {
|
|
110
|
+
const teamId = normalizeMSTeamsConversationTargetId(team);
|
|
111
|
+
if (!channel) return {
|
|
112
|
+
input,
|
|
113
|
+
resolved: true,
|
|
114
|
+
teamId,
|
|
115
|
+
teamName: teamId
|
|
116
|
+
};
|
|
117
|
+
if (!looksLikeMSTeamsThreadConversationId(channel)) return {
|
|
118
|
+
input,
|
|
119
|
+
resolved: false,
|
|
120
|
+
teamId,
|
|
121
|
+
teamName: teamId,
|
|
122
|
+
note: "channel id required for conversation-id team"
|
|
123
|
+
};
|
|
124
|
+
const channelId = normalizeMSTeamsConversationTargetId(channel);
|
|
125
|
+
return {
|
|
126
|
+
input,
|
|
127
|
+
resolved: true,
|
|
128
|
+
teamId,
|
|
129
|
+
teamName: teamId,
|
|
130
|
+
channelId,
|
|
131
|
+
channelName: channelId
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const token = await getToken();
|
|
135
|
+
const teams = /^[0-9a-fA-F-]{16,}$/.test(team) ? [{
|
|
136
|
+
id: team,
|
|
137
|
+
displayName: team
|
|
138
|
+
}] : await listTeamsByName(token, team);
|
|
139
|
+
if (teams.length === 0) return {
|
|
140
|
+
input,
|
|
141
|
+
resolved: false,
|
|
142
|
+
note: "team not found"
|
|
143
|
+
};
|
|
144
|
+
const teamMatch = teams[0];
|
|
145
|
+
const graphTeamId = teamMatch.id?.trim();
|
|
146
|
+
const teamName = teamMatch.displayName?.trim() || team;
|
|
147
|
+
if (!graphTeamId) return {
|
|
148
|
+
input,
|
|
149
|
+
resolved: false,
|
|
150
|
+
note: "team id missing"
|
|
151
|
+
};
|
|
152
|
+
let teamChannels = [];
|
|
153
|
+
try {
|
|
154
|
+
teamChannels = await listChannelsForTeam(token, graphTeamId);
|
|
155
|
+
} catch {}
|
|
156
|
+
const teamId = teamChannels.find((ch) => normalizeOptionalLowercaseString(ch.displayName) === "general")?.id?.trim() || graphTeamId;
|
|
157
|
+
if (!channel) return {
|
|
158
|
+
input,
|
|
159
|
+
resolved: true,
|
|
160
|
+
teamId,
|
|
161
|
+
teamName,
|
|
162
|
+
note: teams.length > 1 ? "multiple teams; chose first" : void 0
|
|
163
|
+
};
|
|
164
|
+
const normalizedChannel = normalizeOptionalLowercaseString(channel);
|
|
165
|
+
const channelMatch = teamChannels.find((item) => item.id === channel) ?? teamChannels.find((item) => normalizeOptionalLowercaseString(item.displayName) === normalizedChannel) ?? teamChannels.find((item) => normalizeLowercaseStringOrEmpty(item.displayName ?? "").includes(normalizedChannel ?? ""));
|
|
166
|
+
if (!channelMatch?.id) return {
|
|
167
|
+
input,
|
|
168
|
+
resolved: false,
|
|
169
|
+
note: "channel not found"
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
input,
|
|
173
|
+
resolved: true,
|
|
174
|
+
teamId,
|
|
175
|
+
teamName,
|
|
176
|
+
channelId: channelMatch.id,
|
|
177
|
+
channelName: channelMatch.displayName ?? channel,
|
|
178
|
+
note: teamChannels.length > 1 ? "multiple channels; chose first" : void 0
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
async function resolveMSTeamsUserAllowlist(params) {
|
|
184
|
+
const token = await resolveGraphToken(params.cfg);
|
|
185
|
+
return await mapAllowlistResolutionInputs({
|
|
186
|
+
inputs: params.entries,
|
|
187
|
+
mapInput: async (input) => {
|
|
188
|
+
const query = normalizeQuery(normalizeMSTeamsUserInput(input));
|
|
189
|
+
if (!query) return {
|
|
190
|
+
input,
|
|
191
|
+
resolved: false
|
|
192
|
+
};
|
|
193
|
+
if (/^[0-9a-fA-F-]{16,}$/.test(query)) return {
|
|
194
|
+
input,
|
|
195
|
+
resolved: true,
|
|
196
|
+
id: query
|
|
197
|
+
};
|
|
198
|
+
const users = await searchGraphUsers({
|
|
199
|
+
token,
|
|
200
|
+
query,
|
|
201
|
+
top: 10
|
|
202
|
+
});
|
|
203
|
+
const match = users[0];
|
|
204
|
+
if (!match?.id) return {
|
|
205
|
+
input,
|
|
206
|
+
resolved: false
|
|
207
|
+
};
|
|
208
|
+
return {
|
|
209
|
+
input,
|
|
210
|
+
resolved: true,
|
|
211
|
+
id: match.id,
|
|
212
|
+
name: match.displayName ?? void 0,
|
|
213
|
+
note: users.length > 1 ? "multiple matches; chose first" : void 0
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { parseMSTeamsTeamChannelInput as a, resolveMSTeamsUserAllowlist as c, parseMSTeamsConversationId as i, normalizeMSTeamsMessagingTarget as n, parseMSTeamsTeamEntry as o, normalizeMSTeamsUserInput as r, resolveMSTeamsChannelAllowlist as s, looksLikeMSTeamsTargetId as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { mergeAllowlist, resolveAllowlistMatchSimple, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
2
|
+
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
3
|
+
import { evaluateSenderGroupAccessForPolicy, readStoreAllowFromForDmPolicy, resolveDmGroupAccessWithLists, resolveEffectiveAllowFromLists, resolveSenderScopedGroupPolicy, resolveToolsBySender } from "openclaw/plugin-sdk/channel-policy";
|
|
4
|
+
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
5
|
+
import { logTypingFailure } from "openclaw/plugin-sdk/channel-logging";
|
|
6
|
+
import { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pipeline";
|
|
7
|
+
import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/channel-status";
|
|
8
|
+
import { buildChannelKeyCandidates, normalizeChannelSlug, resolveChannelEntryMatchWithFallback, resolveNestedAllowlistDecision } from "openclaw/plugin-sdk/channel-targets";
|
|
9
|
+
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
10
|
+
import { resolveDefaultGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
11
|
+
import { withFileLock as withFileLock$1 } from "openclaw/plugin-sdk/file-lock";
|
|
12
|
+
import { keepHttpServerTaskAlive } from "openclaw/plugin-sdk/channel-lifecycle";
|
|
13
|
+
import { detectMime, extensionForMime, extractOriginalFilename, getFileExtension, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
14
|
+
import { dispatchReplyFromConfigWithSettledDispatcher as dispatchReplyFromConfigWithSettledDispatcher$1 } from "openclaw/plugin-sdk/inbound-reply-dispatch";
|
|
15
|
+
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
16
|
+
import { buildMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
17
|
+
import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
18
|
+
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
19
|
+
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
20
|
+
import { DEFAULT_WEBHOOK_MAX_BODY_BYTES } from "openclaw/plugin-sdk/webhook-ingress";
|
|
21
|
+
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
22
|
+
//#region extensions/msteams/src/runtime.ts
|
|
23
|
+
const { setRuntime: setMSTeamsRuntime, getRuntime: getMSTeamsRuntime, tryGetRuntime: getOptionalMSTeamsRuntime } = createPluginRuntimeStore({
|
|
24
|
+
pluginId: "msteams",
|
|
25
|
+
errorMessage: "MSTeams runtime not initialized"
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { resolveDmGroupAccessWithLists as A, normalizeChannelSlug as C, resolveChannelEntryMatchWithFallback as D, resolveAllowlistMatchSimple as E, summarizeMapping as F, withFileLock$1 as I, getMSTeamsRuntime as L, resolveNestedAllowlistDecision as M, resolveSenderScopedGroupPolicy as N, resolveChannelMediaMaxBytes as O, resolveToolsBySender as P, getOptionalMSTeamsRuntime as R, mergeAllowlist as S, readStoreAllowFromForDmPolicy as T, getFileExtension as _, buildMediaPayload as a, loadOutboundMediaFromUrl as b, createChannelPairingController as c, detectMime as d, dispatchReplyFromConfigWithSettledDispatcher$1 as f, fetchWithSsrFGuard$1 as g, extractOriginalFilename as h, buildChannelKeyCandidates as i, resolveEffectiveAllowFromLists as j, resolveDefaultGroupPolicy as k, createChannelReplyPipeline as l, extensionForMime as m, DEFAULT_WEBHOOK_MAX_BODY_BYTES as n, buildProbeChannelStatusSummary as o, evaluateSenderGroupAccessForPolicy as p, PAIRING_APPROVED_MESSAGE as r, chunkTextForOutbound as s, DEFAULT_ACCOUNT_ID as t, createDefaultChannelRuntimeState as u, isDangerousNameMatchingEnabled as v, normalizeStringEntries as w, logTypingFailure as x, keepHttpServerTaskAlive as y, setMSTeamsRuntime as z };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as resolveDmGroupAccessWithLists, C as normalizeChannelSlug, D as resolveChannelEntryMatchWithFallback, E as resolveAllowlistMatchSimple, F as summarizeMapping, I as withFileLock, M as resolveNestedAllowlistDecision, N as resolveSenderScopedGroupPolicy, O as resolveChannelMediaMaxBytes, P as resolveToolsBySender, S as mergeAllowlist, T as readStoreAllowFromForDmPolicy, _ as getFileExtension, a as buildMediaPayload, b as loadOutboundMediaFromUrl, c as createChannelPairingController, d as detectMime, f as dispatchReplyFromConfigWithSettledDispatcher, g as fetchWithSsrFGuard, h as extractOriginalFilename, i as buildChannelKeyCandidates, j as resolveEffectiveAllowFromLists, k as resolveDefaultGroupPolicy, l as createChannelReplyPipeline, m as extensionForMime, n as DEFAULT_WEBHOOK_MAX_BODY_BYTES, o as buildProbeChannelStatusSummary, p as evaluateSenderGroupAccessForPolicy, r as PAIRING_APPROVED_MESSAGE, s as chunkTextForOutbound, t as DEFAULT_ACCOUNT_ID, u as createDefaultChannelRuntimeState, v as isDangerousNameMatchingEnabled, w as normalizeStringEntries, x as logTypingFailure, y as keepHttpServerTaskAlive, z as setMSTeamsRuntime } from "./runtime-api-DV1iVMn1.js";
|
|
2
|
+
export { DEFAULT_ACCOUNT_ID, DEFAULT_WEBHOOK_MAX_BODY_BYTES, PAIRING_APPROVED_MESSAGE, buildChannelKeyCandidates, buildMediaPayload, buildProbeChannelStatusSummary, chunkTextForOutbound, createChannelPairingController, createChannelReplyPipeline, createDefaultChannelRuntimeState, detectMime, dispatchReplyFromConfigWithSettledDispatcher, evaluateSenderGroupAccessForPolicy, extensionForMime, extractOriginalFilename, fetchWithSsrFGuard, getFileExtension, isDangerousNameMatchingEnabled, keepHttpServerTaskAlive, loadOutboundMediaFromUrl, logTypingFailure, mergeAllowlist, normalizeChannelSlug, normalizeStringEntries, readStoreAllowFromForDmPolicy, resolveAllowlistMatchSimple, resolveChannelEntryMatchWithFallback, resolveChannelMediaMaxBytes, resolveDefaultGroupPolicy, resolveDmGroupAccessWithLists, resolveEffectiveAllowFromLists, resolveNestedAllowlistDecision, resolveSenderScopedGroupPolicy, resolveToolsBySender, setMSTeamsRuntime, summarizeMapping, withFileLock };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { collectSecretInputAssignment, getChannelRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
2
|
+
//#region extensions/msteams/src/secret-contract.ts
|
|
3
|
+
const secretTargetRegistryEntries = [{
|
|
4
|
+
id: "channels.msteams.appPassword",
|
|
5
|
+
targetType: "channels.msteams.appPassword",
|
|
6
|
+
configFile: "openclaw.json",
|
|
7
|
+
pathPattern: "channels.msteams.appPassword",
|
|
8
|
+
secretShape: "secret_input",
|
|
9
|
+
expectedResolvedValue: "string",
|
|
10
|
+
includeInPlan: true,
|
|
11
|
+
includeInConfigure: true,
|
|
12
|
+
includeInAudit: true
|
|
13
|
+
}];
|
|
14
|
+
function collectRuntimeConfigAssignments(params) {
|
|
15
|
+
const msteams = getChannelRecord(params.config, "msteams");
|
|
16
|
+
if (!msteams) return;
|
|
17
|
+
collectSecretInputAssignment({
|
|
18
|
+
value: msteams.appPassword,
|
|
19
|
+
path: "channels.msteams.appPassword",
|
|
20
|
+
expected: "string",
|
|
21
|
+
defaults: params.defaults,
|
|
22
|
+
context: params.context,
|
|
23
|
+
active: msteams.enabled !== false,
|
|
24
|
+
inactiveReason: "Microsoft Teams channel is disabled.",
|
|
25
|
+
apply: (value) => {
|
|
26
|
+
msteams.appPassword = value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const channelSecrets = {
|
|
31
|
+
secretTargetRegistryEntries,
|
|
32
|
+
collectRuntimeConfigAssignments
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
2
|
+
//#region extensions/msteams/setup-entry.ts
|
|
3
|
+
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
4
|
+
importMetaUrl: import.meta.url,
|
|
5
|
+
plugin: {
|
|
6
|
+
specifier: "./setup-plugin-api.js",
|
|
7
|
+
exportName: "msteamsSetupPlugin"
|
|
8
|
+
},
|
|
9
|
+
secrets: {
|
|
10
|
+
specifier: "./secret-contract-api.js",
|
|
11
|
+
exportName: "channelSecrets"
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { setup_entry_default as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { h as resolveMSTeamsCredentials } from "./graph-users-9uQJepqr.js";
|
|
2
|
+
import { t as MSTeamsChannelConfigSchema } from "./config-schema-B8QezH6t.js";
|
|
3
|
+
import { i as msteamsSetupAdapter, t as msteamsSetupWizard } from "./setup-surface-BLkFQYIQ.js";
|
|
4
|
+
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
5
|
+
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
6
|
+
import { createTopLevelChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
7
|
+
//#region extensions/msteams/src/channel.setup.ts
|
|
8
|
+
const meta = {
|
|
9
|
+
id: "msteams",
|
|
10
|
+
label: "Microsoft Teams",
|
|
11
|
+
selectionLabel: "Microsoft Teams (Bot Framework)",
|
|
12
|
+
docsPath: "/channels/msteams",
|
|
13
|
+
docsLabel: "msteams",
|
|
14
|
+
blurb: "Teams SDK; enterprise support.",
|
|
15
|
+
aliases: ["teams"],
|
|
16
|
+
order: 60
|
|
17
|
+
};
|
|
18
|
+
const resolveMSTeamsChannelConfig = (cfg) => ({
|
|
19
|
+
allowFrom: cfg.channels?.msteams?.allowFrom,
|
|
20
|
+
defaultTo: cfg.channels?.msteams?.defaultTo
|
|
21
|
+
});
|
|
22
|
+
const msteamsConfigAdapter = createTopLevelChannelConfigAdapter({
|
|
23
|
+
sectionKey: "msteams",
|
|
24
|
+
resolveAccount: (cfg) => ({
|
|
25
|
+
accountId: "default",
|
|
26
|
+
enabled: cfg.channels?.msteams?.enabled !== false,
|
|
27
|
+
configured: Boolean(resolveMSTeamsCredentials(cfg.channels?.msteams))
|
|
28
|
+
}),
|
|
29
|
+
resolveAccessorAccount: ({ cfg }) => resolveMSTeamsChannelConfig(cfg),
|
|
30
|
+
resolveAllowFrom: (account) => account.allowFrom,
|
|
31
|
+
formatAllowFrom: (allowFrom) => formatAllowFromLowercase({ allowFrom }),
|
|
32
|
+
resolveDefaultTo: (account) => account.defaultTo
|
|
33
|
+
});
|
|
34
|
+
const msteamsSetupPlugin = {
|
|
35
|
+
id: "msteams",
|
|
36
|
+
meta: {
|
|
37
|
+
...meta,
|
|
38
|
+
aliases: [...meta.aliases]
|
|
39
|
+
},
|
|
40
|
+
capabilities: {
|
|
41
|
+
chatTypes: [
|
|
42
|
+
"direct",
|
|
43
|
+
"channel",
|
|
44
|
+
"thread"
|
|
45
|
+
],
|
|
46
|
+
polls: true,
|
|
47
|
+
threads: true,
|
|
48
|
+
media: true
|
|
49
|
+
},
|
|
50
|
+
reload: { configPrefixes: ["channels.msteams"] },
|
|
51
|
+
configSchema: MSTeamsChannelConfigSchema,
|
|
52
|
+
config: {
|
|
53
|
+
...msteamsConfigAdapter,
|
|
54
|
+
isConfigured: (_account, cfg) => Boolean(resolveMSTeamsCredentials(cfg.channels?.msteams)),
|
|
55
|
+
describeAccount: (account) => describeAccountSnapshot({
|
|
56
|
+
account,
|
|
57
|
+
configured: account.configured
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
setupWizard: msteamsSetupWizard,
|
|
61
|
+
setup: msteamsSetupAdapter
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { msteamsSetupPlugin };
|