@openclaw/msteams 2026.9.6 → 2026.9.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/assets/icon.png +0 -0
- package/dist/.setup/{adapter.runtime-CQWZeqB5.cjs → adapter.runtime-BiWeMKXE.cjs} +21 -29
- package/dist/.setup/{approval-card-CPNH_q3P.cjs → approval-card-DWPDItvq.cjs} +6 -3
- package/dist/.setup/{approval-handler.runtime-CUnanUdR.cjs → approval-handler.runtime-D1s7UR3U.cjs} +4 -4
- package/dist/.setup/bot-framework-service-url-BUhTe8F3.cjs +55 -0
- package/dist/.setup/{channel-BDp16XRR.cjs → channel-ByzS7QJ0.cjs} +286 -180
- package/dist/.setup/{channel.runtime-Cv5F8JCa.cjs → channel.runtime-Baz8XDFs.cjs} +43 -142
- package/dist/.setup/{channel.setup-BVDfgdCc.cjs → channel.setup-DL8lcWT_.cjs} +6 -6
- package/dist/.setup/{config-schema-D22Lr1Qk.cjs → config-schema-0KoBzb0t.cjs} +24 -38
- package/dist/.setup/{messenger-8RA1FUJa.cjs → conversation-store-state-B7JuyZTm.cjs} +693 -287
- package/dist/.setup/{src-BfOCwlHp.cjs → monitor-BJ7IyH4y.cjs} +422 -592
- package/dist/.setup/{oauth-C6m7dvHj.cjs → oauth-DQjOnJ4l.cjs} +1 -1
- package/dist/.setup/{reaction-types-C7RA7Wxt.cjs → reaction-types-CQ4oSUe7.cjs} +2 -6
- package/dist/.setup/{resolve-allowlist-CHzaaWiC.cjs → resolve-allowlist-Pl_NQFYH.cjs} +55 -312
- package/dist/.setup/{rolldown-runtime-VH7oDXx4.cjs → rolldown-runtime-BloeesfJ.cjs} +22 -0
- package/dist/.setup/{send-CYN_N7O1.cjs → send-VUM7Sryb.cjs} +43 -96
- package/dist/.setup/{setup-plugin-api-DpiaA8z1.cjs → setup-plugin-api-Dyf8kF-l.cjs} +1 -1
- package/dist/.setup/{thread-session-CXgHK-yi.cjs → thread-session--rw3BTal.cjs} +2 -5
- package/dist/api.cjs +2 -2
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/configured-state.cjs +0 -1
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +201 -371
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/runtime-api.cjs +0 -6
- package/dist/setup-entry.cjs +1 -1
- package/dist/setup-plugin-api.cjs +1 -1
- package/openclaw.plugin.json +46 -5
- package/package.json +9 -9
- package/dist/.setup/polls-BJ4-4uZm.cjs +0 -668
- package/dist/.setup/secret-input-C65t6kjM.cjs +0 -1
- package/dist/.setup/sso-token-store-YYLHXgFH.cjs +0 -111
|
@@ -5,6 +5,15 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
8
17
|
var __copyProps = (to, from, except, desc) => {
|
|
9
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
19
|
key = keys[i];
|
|
@@ -15,11 +24,24 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
24
|
}
|
|
16
25
|
return to;
|
|
17
26
|
};
|
|
27
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
28
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
29
|
value: mod,
|
|
20
30
|
enumerable: true
|
|
21
31
|
}) : target, mod));
|
|
22
32
|
//#endregion
|
|
33
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return __exportAll;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "__reExport", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function() {
|
|
42
|
+
return __reExport;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
23
45
|
Object.defineProperty(exports, "__toESM", {
|
|
24
46
|
enumerable: true,
|
|
25
47
|
get: function() {
|
|
@@ -1,10 +1,10 @@
|
|
|
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
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const require_resolve_allowlist = require("./resolve-allowlist-Pl_NQFYH.cjs");
|
|
4
|
+
const require_bot_framework_service_url = require("./bot-framework-service-url-BUhTe8F3.cjs");
|
|
5
|
+
const require_channel = require("./channel-ByzS7QJ0.cjs");
|
|
6
|
+
const require_channel_setup = require("./channel.setup-DL8lcWT_.cjs");
|
|
7
|
+
const require_conversation_store_state = require("./conversation-store-state-B7JuyZTm.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_error_runtime = require("openclaw/plugin-sdk/error-runtime");
|
|
@@ -67,24 +67,19 @@ function parseRecipient(to) {
|
|
|
67
67
|
if (trimmed.startsWith("19:") || trimmed.includes("@thread")) return finalize("conversation", trimmed);
|
|
68
68
|
return finalize("user", trimmed);
|
|
69
69
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Find a stored conversation reference for the given recipient.
|
|
72
|
-
*/
|
|
73
70
|
async function findConversationReference(recipient) {
|
|
74
71
|
if (recipient.type === "conversation") {
|
|
75
72
|
const ref = await recipient.store.get(recipient.id);
|
|
76
|
-
|
|
73
|
+
return ref ? {
|
|
77
74
|
conversationId: recipient.id,
|
|
78
75
|
ref
|
|
79
|
-
};
|
|
80
|
-
return null;
|
|
76
|
+
} : null;
|
|
81
77
|
}
|
|
82
78
|
const found = await recipient.store.findPreferredDmByUserId(recipient.id);
|
|
83
|
-
|
|
84
|
-
return {
|
|
79
|
+
return found ? {
|
|
85
80
|
conversationId: found.conversationId,
|
|
86
81
|
ref: found.reference
|
|
87
|
-
};
|
|
82
|
+
} : null;
|
|
88
83
|
}
|
|
89
84
|
async function resolveMSTeamsSendContext(params) {
|
|
90
85
|
const msteamsCfg = params.cfg.channels?.msteams;
|
|
@@ -94,7 +89,7 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
94
89
|
if (!account.configured) throw new Error("msteams credentials not configured");
|
|
95
90
|
const creds = require_resolve_allowlist.resolveMSTeamsCredentials(msteamsCfg);
|
|
96
91
|
if (!creds) throw new Error("msteams credentials not configured");
|
|
97
|
-
const store =
|
|
92
|
+
const store = require_conversation_store_state.createMSTeamsConversationStoreState();
|
|
98
93
|
const recipient = parseRecipient(params.to);
|
|
99
94
|
const found = await findConversationReference({
|
|
100
95
|
...recipient,
|
|
@@ -107,7 +102,7 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
107
102
|
threadId: recipient.threadId
|
|
108
103
|
} : found.ref;
|
|
109
104
|
const log = require_runtime.getMSTeamsRuntime().logging.getChildLogger({ name: "msteams:send" });
|
|
110
|
-
if (ref.serviceUrl && !
|
|
105
|
+
if (ref.serviceUrl && !require_bot_framework_service_url.isAllowedBotFrameworkServiceUrl(ref.serviceUrl)) {
|
|
111
106
|
try {
|
|
112
107
|
await store.remove(conversationId);
|
|
113
108
|
} catch (err) {
|
|
@@ -116,11 +111,11 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
116
111
|
error: require_channel_setup.formatUnknownError(err)
|
|
117
112
|
});
|
|
118
113
|
}
|
|
119
|
-
throw new Error(`Stored Microsoft Teams conversation reference has blocked serviceUrl host: ${
|
|
114
|
+
throw new Error(`Stored Microsoft Teams conversation reference has blocked serviceUrl host: ${require_bot_framework_service_url.describeBotFrameworkServiceUrlHost(ref.serviceUrl)}. The bot must receive a new message from this conversation before it can send proactively.`);
|
|
120
115
|
}
|
|
121
116
|
const safeRef = ref.serviceUrl ? {
|
|
122
117
|
...ref,
|
|
123
|
-
serviceUrl:
|
|
118
|
+
serviceUrl: require_bot_framework_service_url.normalizeBotFrameworkServiceUrl(ref.serviceUrl)
|
|
124
119
|
} : ref;
|
|
125
120
|
if (recipient.type === "user") {
|
|
126
121
|
const resolvedType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(safeRef.conversation?.conversationType ?? "");
|
|
@@ -136,10 +131,7 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
136
131
|
});
|
|
137
132
|
const tokenProvider = require_resolve_allowlist.createMSTeamsTokenProvider(app);
|
|
138
133
|
const storedConversationType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(safeRef.conversation?.conversationType ?? "");
|
|
139
|
-
|
|
140
|
-
if (storedConversationType === "personal") conversationType = "personal";
|
|
141
|
-
else if (storedConversationType === "channel") conversationType = "channel";
|
|
142
|
-
else conversationType = "groupChat";
|
|
134
|
+
const conversationType = storedConversationType === "personal" || storedConversationType === "channel" ? storedConversationType : "groupChat";
|
|
143
135
|
const replyTarget = recipient.threadId && conversationType === "channel" ? {
|
|
144
136
|
replyStyle: "thread",
|
|
145
137
|
threadActivityId: recipient.threadId
|
|
@@ -149,7 +141,6 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
149
141
|
ref: safeRef,
|
|
150
142
|
conversationType
|
|
151
143
|
});
|
|
152
|
-
const sharePointSiteId = msteamsCfg.sharePointSiteId;
|
|
153
144
|
const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
|
|
154
145
|
cfg: params.cfg,
|
|
155
146
|
resolveChannelLimitMb: ({ cfg }) => cfg.channels?.msteams?.mediaMaxMb
|
|
@@ -164,13 +155,12 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
164
155
|
...replyTarget,
|
|
165
156
|
sdkCloudOptions,
|
|
166
157
|
tokenProvider,
|
|
167
|
-
sharePointSiteId,
|
|
158
|
+
sharePointSiteId: msteamsCfg.sharePointSiteId,
|
|
168
159
|
mediaMaxBytes
|
|
169
160
|
};
|
|
170
161
|
}
|
|
171
162
|
//#endregion
|
|
172
163
|
//#region extensions/msteams/src/send.ts
|
|
173
|
-
/** Threshold for large files that require FileConsentCard flow in personal chats */
|
|
174
164
|
const FILE_CONSENT_THRESHOLD_BYTES = 4194304;
|
|
175
165
|
/**
|
|
176
166
|
* MSTeams-specific media size limit (100MB).
|
|
@@ -208,22 +198,8 @@ function createMSTeamsSendReceipt(params) {
|
|
|
208
198
|
conversationId: params.conversationId
|
|
209
199
|
}))
|
|
210
200
|
});
|
|
211
|
-
if (
|
|
212
|
-
|
|
213
|
-
return {
|
|
214
|
-
...receipt,
|
|
215
|
-
parts: receipt.parts.map((part, index) => {
|
|
216
|
-
const nextPart = {
|
|
217
|
-
platformMessageId: part.platformMessageId,
|
|
218
|
-
kind: kinds[index] ?? params.kind,
|
|
219
|
-
index: part.index
|
|
220
|
-
};
|
|
221
|
-
if (part.threadId) nextPart.threadId = part.threadId;
|
|
222
|
-
if (part.replyToId) nextPart.replyToId = part.replyToId;
|
|
223
|
-
if (part.raw) nextPart.raw = part.raw;
|
|
224
|
-
return nextPart;
|
|
225
|
-
})
|
|
226
|
-
};
|
|
201
|
+
if (params.kinds) for (const [index, part] of receipt.parts.entries()) part.kind = params.kinds[index] ?? params.kind;
|
|
202
|
+
return receipt;
|
|
227
203
|
}
|
|
228
204
|
function createMSTeamsSendResult(params) {
|
|
229
205
|
const platformMessageIds = (params.platformMessageIds?.length ? [...params.platformMessageIds] : [params.messageId]).map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown");
|
|
@@ -256,7 +232,7 @@ async function sendMessageMSTeams(params) {
|
|
|
256
232
|
cfg,
|
|
257
233
|
channel: "msteams"
|
|
258
234
|
});
|
|
259
|
-
const messageText =
|
|
235
|
+
const messageText = require_conversation_store_state.formatMSTeamsMarkdown(text ?? "", tableMode);
|
|
260
236
|
const ctx = await resolveMSTeamsSendContext({
|
|
261
237
|
cfg,
|
|
262
238
|
to
|
|
@@ -278,7 +254,7 @@ async function sendMessageMSTeams(params) {
|
|
|
278
254
|
});
|
|
279
255
|
const isLargeFile = media.buffer.length >= FILE_CONSENT_THRESHOLD_BYTES;
|
|
280
256
|
const isImage = media.contentType?.startsWith("image/") ?? false;
|
|
281
|
-
const fallbackFileName = await
|
|
257
|
+
const fallbackFileName = await require_conversation_store_state.extractFilename(mediaUrl);
|
|
282
258
|
const fileName = filename?.trim() || media.fileName || fallbackFileName;
|
|
283
259
|
log.debug?.("processing media", {
|
|
284
260
|
fileName,
|
|
@@ -288,14 +264,14 @@ async function sendMessageMSTeams(params) {
|
|
|
288
264
|
isImage,
|
|
289
265
|
conversationType
|
|
290
266
|
});
|
|
291
|
-
if (
|
|
267
|
+
if (require_conversation_store_state.requiresFileConsent({
|
|
292
268
|
conversationType,
|
|
293
269
|
contentType: media.contentType,
|
|
294
270
|
bufferSize: media.buffer.length,
|
|
295
271
|
thresholdBytes: FILE_CONSENT_THRESHOLD_BYTES
|
|
296
272
|
})) {
|
|
297
273
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
298
|
-
const { activity, uploadId } = await
|
|
274
|
+
const { activity, uploadId } = await require_conversation_store_state.prepareFileConsentActivityFs({
|
|
299
275
|
media: {
|
|
300
276
|
buffer: media.buffer,
|
|
301
277
|
filename: fileName,
|
|
@@ -323,11 +299,11 @@ async function sendMessageMSTeams(params) {
|
|
|
323
299
|
pendingUploadId: uploadId
|
|
324
300
|
});
|
|
325
301
|
return finishMSTeamsSend(result, async () => {
|
|
326
|
-
|
|
302
|
+
require_conversation_store_state.setPendingUploadActivityId(uploadId, messageId);
|
|
327
303
|
try {
|
|
328
304
|
await params.onDeliveryResult?.(result);
|
|
329
305
|
} finally {
|
|
330
|
-
await
|
|
306
|
+
await require_conversation_store_state.setPendingUploadActivityIdFs(uploadId, messageId);
|
|
331
307
|
}
|
|
332
308
|
log.info("sent file consent card", {
|
|
333
309
|
conversationId,
|
|
@@ -336,22 +312,18 @@ async function sendMessageMSTeams(params) {
|
|
|
336
312
|
});
|
|
337
313
|
});
|
|
338
314
|
}
|
|
339
|
-
if (conversationType === "personal") {
|
|
340
|
-
const base64 = media.buffer.toString("base64");
|
|
341
|
-
return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`, params);
|
|
342
|
-
}
|
|
343
|
-
if (isImage && !sharePointSiteId) {
|
|
315
|
+
if (conversationType === "personal" || isImage && !sharePointSiteId) {
|
|
344
316
|
const base64 = media.buffer.toString("base64");
|
|
345
317
|
return sendTextWithMedia(ctx, messageText, `data:${media.contentType};base64,${base64}`, params);
|
|
346
318
|
}
|
|
347
319
|
try {
|
|
348
|
-
const siteId =
|
|
320
|
+
const siteId = require_conversation_store_state.requireMSTeamsSharePointSiteId(sharePointSiteId);
|
|
349
321
|
log.debug?.("uploading to SharePoint for native file card", {
|
|
350
322
|
fileName,
|
|
351
323
|
conversationType,
|
|
352
324
|
siteId
|
|
353
325
|
});
|
|
354
|
-
const uploaded = await
|
|
326
|
+
const uploaded = await require_conversation_store_state.uploadAndShareSharePoint({
|
|
355
327
|
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
|
|
356
328
|
buffer: media.buffer,
|
|
357
329
|
filename: fileName,
|
|
@@ -365,7 +337,7 @@ async function sendMessageMSTeams(params) {
|
|
|
365
337
|
itemId: uploaded.itemId,
|
|
366
338
|
shareUrl: uploaded.shareUrl
|
|
367
339
|
});
|
|
368
|
-
const driveItem = await
|
|
340
|
+
const driveItem = await require_conversation_store_state.getDriveItemProperties({
|
|
369
341
|
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
|
|
370
342
|
siteId,
|
|
371
343
|
itemId: uploaded.itemId,
|
|
@@ -375,11 +347,11 @@ async function sendMessageMSTeams(params) {
|
|
|
375
347
|
eTag: driveItem.eTag,
|
|
376
348
|
webDavUrl: driveItem.webDavUrl
|
|
377
349
|
});
|
|
378
|
-
const fileCardAttachment =
|
|
350
|
+
const fileCardAttachment = require_conversation_store_state.buildTeamsFileInfoCard(driveItem);
|
|
379
351
|
const messageId = await sendProactiveActivityRaw({
|
|
380
352
|
ctx,
|
|
381
353
|
activity: {
|
|
382
|
-
...
|
|
354
|
+
...require_conversation_store_state.buildMSTeamsMessageActivity(messageText || void 0),
|
|
383
355
|
attachments: [fileCardAttachment]
|
|
384
356
|
},
|
|
385
357
|
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
|
|
@@ -404,9 +376,6 @@ async function sendMessageMSTeams(params) {
|
|
|
404
376
|
}
|
|
405
377
|
return sendTextWithMedia(ctx, messageText, void 0, params);
|
|
406
378
|
}
|
|
407
|
-
/**
|
|
408
|
-
* Send a text message with optional base64 media URL.
|
|
409
|
-
*/
|
|
410
379
|
async function sendTextWithMedia(ctx, text, mediaUrl, options) {
|
|
411
380
|
const { app, appId, conversationId, ref, log, tokenProvider, sharePointSiteId, mediaMaxBytes, replyStyle } = ctx;
|
|
412
381
|
const messages = text && mediaUrl ? [{ text }, { mediaUrl }] : [{
|
|
@@ -417,7 +386,7 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
|
|
|
417
386
|
const acceptedIds = [];
|
|
418
387
|
const acceptedKinds = [];
|
|
419
388
|
try {
|
|
420
|
-
platformMessageIds = await
|
|
389
|
+
platformMessageIds = await require_conversation_store_state.sendMSTeamsMessages({
|
|
421
390
|
assertDirectAdapterHandoff: options.assertDirectAdapterHandoff,
|
|
422
391
|
onPlatformSendDispatch: options.onPlatformSendDispatch,
|
|
423
392
|
onMessageSent: async (messageId, messageIndex) => {
|
|
@@ -474,14 +443,14 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
|
|
|
474
443
|
};
|
|
475
444
|
}
|
|
476
445
|
async function sendProactiveActivityRaw({ ctx, activity, assertDirectAdapterHandoff, onPlatformSendDispatch }) {
|
|
477
|
-
const baseRef =
|
|
478
|
-
const response = await
|
|
446
|
+
const baseRef = require_conversation_store_state.buildConversationReference(ctx.ref);
|
|
447
|
+
const response = await require_conversation_store_state.sendMSTeamsActivityWithReference(ctx.app, baseRef, activity, {
|
|
479
448
|
assertDirectAdapterHandoff,
|
|
480
449
|
onPlatformSendDispatch,
|
|
481
450
|
...ctx.threadActivityId ? { threadActivityId: ctx.threadActivityId } : {},
|
|
482
451
|
serviceUrlBoundary: ctx.sdkCloudOptions
|
|
483
452
|
});
|
|
484
|
-
return
|
|
453
|
+
return require_conversation_store_state.extractMessageId(response) ?? "unknown";
|
|
485
454
|
}
|
|
486
455
|
async function sendProactiveActivity(params) {
|
|
487
456
|
try {
|
|
@@ -490,9 +459,6 @@ async function sendProactiveActivity(params) {
|
|
|
490
459
|
throw createMSTeamsSendError(params.errorPrefix, err);
|
|
491
460
|
}
|
|
492
461
|
}
|
|
493
|
-
/**
|
|
494
|
-
* Send a poll (Adaptive Card) to a Teams conversation or user.
|
|
495
|
-
*/
|
|
496
462
|
async function sendPollMSTeams(params) {
|
|
497
463
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
498
464
|
const { cfg, to, question, options, maxSelections } = params;
|
|
@@ -501,7 +467,7 @@ async function sendPollMSTeams(params) {
|
|
|
501
467
|
to
|
|
502
468
|
});
|
|
503
469
|
const { conversationId, log } = ctx;
|
|
504
|
-
const pollCard =
|
|
470
|
+
const pollCard = require_conversation_store_state.buildMSTeamsPollCard({
|
|
505
471
|
question,
|
|
506
472
|
options,
|
|
507
473
|
maxSelections
|
|
@@ -513,13 +479,7 @@ async function sendPollMSTeams(params) {
|
|
|
513
479
|
});
|
|
514
480
|
const messageId = await sendProactiveActivity({
|
|
515
481
|
ctx,
|
|
516
|
-
activity:
|
|
517
|
-
type: "message",
|
|
518
|
-
attachments: [{
|
|
519
|
-
contentType: "application/vnd.microsoft.card.adaptive",
|
|
520
|
-
content: pollCard.card
|
|
521
|
-
}]
|
|
522
|
-
},
|
|
482
|
+
activity: require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(pollCard.card),
|
|
523
483
|
errorPrefix: "msteams poll send",
|
|
524
484
|
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
|
|
525
485
|
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
@@ -535,9 +495,6 @@ async function sendPollMSTeams(params) {
|
|
|
535
495
|
conversationId
|
|
536
496
|
};
|
|
537
497
|
}
|
|
538
|
-
/**
|
|
539
|
-
* Send an arbitrary Adaptive Card to a Teams conversation or user.
|
|
540
|
-
*/
|
|
541
498
|
async function sendAdaptiveCardMSTeams(params) {
|
|
542
499
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
543
500
|
const { cfg, to, card } = params;
|
|
@@ -553,13 +510,7 @@ async function sendAdaptiveCardMSTeams(params) {
|
|
|
553
510
|
});
|
|
554
511
|
const messageId = await sendProactiveActivity({
|
|
555
512
|
ctx,
|
|
556
|
-
activity:
|
|
557
|
-
type: "message",
|
|
558
|
-
attachments: [{
|
|
559
|
-
contentType: "application/vnd.microsoft.card.adaptive",
|
|
560
|
-
content: card
|
|
561
|
-
}]
|
|
562
|
-
},
|
|
513
|
+
activity: require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(card),
|
|
563
514
|
errorPrefix: "msteams card send",
|
|
564
515
|
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff,
|
|
565
516
|
onPlatformSendDispatch: params.onPlatformSendDispatch
|
|
@@ -587,7 +538,7 @@ async function editMessageMSTeams(params) {
|
|
|
587
538
|
return updateMSTeamsMessageActivity({
|
|
588
539
|
...params,
|
|
589
540
|
activity: {
|
|
590
|
-
...
|
|
541
|
+
...require_conversation_store_state.buildMSTeamsMessageActivity(require_conversation_store_state.formatMSTeamsMarkdown(params.text, (0, openclaw_plugin_sdk_markdown_table_runtime.resolveMarkdownTableMode)({
|
|
591
542
|
cfg: params.cfg,
|
|
592
543
|
channel: "msteams"
|
|
593
544
|
}))),
|
|
@@ -599,12 +550,8 @@ async function editAdaptiveCardMSTeams(params) {
|
|
|
599
550
|
return updateMSTeamsMessageActivity({
|
|
600
551
|
...params,
|
|
601
552
|
activity: {
|
|
602
|
-
|
|
603
|
-
id: params.activityId
|
|
604
|
-
attachments: [{
|
|
605
|
-
contentType: "application/vnd.microsoft.card.adaptive",
|
|
606
|
-
content: params.card
|
|
607
|
-
}]
|
|
553
|
+
...require_conversation_store_state.buildMSTeamsAdaptiveCardActivity(params.card),
|
|
554
|
+
id: params.activityId
|
|
608
555
|
}
|
|
609
556
|
});
|
|
610
557
|
}
|
|
@@ -619,8 +566,8 @@ async function updateMSTeamsMessageActivity(params) {
|
|
|
619
566
|
activityId
|
|
620
567
|
});
|
|
621
568
|
try {
|
|
622
|
-
const baseRef =
|
|
623
|
-
await
|
|
569
|
+
const baseRef = require_conversation_store_state.buildConversationReference(ref);
|
|
570
|
+
await require_conversation_store_state.updateMSTeamsActivityWithReference(app, baseRef, activityId, activity, { serviceUrlBoundary: sdkCloudOptions });
|
|
624
571
|
} catch (err) {
|
|
625
572
|
throw createMSTeamsSendError("msteams edit", err);
|
|
626
573
|
}
|
|
@@ -647,8 +594,8 @@ async function deleteMessageMSTeams(params) {
|
|
|
647
594
|
activityId
|
|
648
595
|
});
|
|
649
596
|
try {
|
|
650
|
-
const baseRef =
|
|
651
|
-
await
|
|
597
|
+
const baseRef = require_conversation_store_state.buildConversationReference(ref);
|
|
598
|
+
await require_conversation_store_state.deleteMSTeamsActivityWithReference(app, baseRef, activityId, { serviceUrlBoundary: sdkCloudOptions });
|
|
652
599
|
} catch (err) {
|
|
653
600
|
throw createMSTeamsSendError("msteams delete", err);
|
|
654
601
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-Pl_NQFYH.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");
|
|
@@ -9,13 +9,10 @@ function normalizeMSTeamsApproverId(value) {
|
|
|
9
9
|
const id = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalLowercaseString)(normalized?.startsWith("user:") ? normalized.slice(5) : normalized);
|
|
10
10
|
return id && MSTEAMS_ID_RE.test(id) ? id : void 0;
|
|
11
11
|
}
|
|
12
|
-
function resolveMSTeamsChannelConfig(cfg) {
|
|
13
|
-
return cfg.channels?.msteams;
|
|
14
|
-
}
|
|
15
12
|
const msTeamsApproval = (0, openclaw_plugin_sdk_approval_auth_runtime.createChannelApprovalAuth)({
|
|
16
13
|
channelLabel: "Microsoft Teams",
|
|
17
14
|
resolveInputs: ({ cfg }) => {
|
|
18
|
-
const channel =
|
|
15
|
+
const channel = cfg.channels?.msteams;
|
|
19
16
|
return {
|
|
20
17
|
allowFrom: channel?.allowFrom,
|
|
21
18
|
defaultTo: channel?.defaultTo
|
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_channel = require("./.setup/channel-
|
|
3
|
-
const require_channel_setup = require("./.setup/channel.setup-
|
|
2
|
+
const require_channel = require("./.setup/channel-ByzS7QJ0.cjs");
|
|
3
|
+
const require_channel_setup = require("./.setup/channel.setup-DL8lcWT_.cjs");
|
|
4
4
|
exports.createMSTeamsSetupWizardBase = require_channel_setup.createMSTeamsSetupWizardBase;
|
|
5
5
|
exports.msteamsPlugin = require_channel.msteamsPlugin;
|
|
6
6
|
exports.msteamsSetupAdapter = require_channel_setup.msteamsSetupAdapter;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_config_schema = require("./.setup/config-schema-
|
|
2
|
+
const require_config_schema = require("./.setup/config-schema-0KoBzb0t.cjs");
|
|
3
3
|
exports.MSTeamsChannelConfigSchema = require_config_schema.MSTeamsChannelConfigSchema;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./.setup/secret-input-C65t6kjM.cjs");
|
|
3
2
|
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
4
3
|
//#region extensions/msteams/configured-state.ts
|
|
5
4
|
/** Mirror Teams auth-mode requirements without loading the Azure SDK or full channel. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_resolve_allowlist = require("./.setup/resolve-allowlist-
|
|
2
|
+
const require_resolve_allowlist = require("./.setup/resolve-allowlist-Pl_NQFYH.cjs");
|
|
3
3
|
let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
|
|
4
4
|
const msteamsDirectoryContractPlugin = {
|
|
5
5
|
id: "msteams",
|