@openclaw/msteams 2026.11.5-beta.1 → 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-UOD_H_ph.cjs → adapter.runtime-BB38Rdj_.cjs} +5 -3
- package/dist/.setup/{approval-card-CD5q0Nla.cjs → approval-card-BHAKsdAM.cjs} +4 -2
- package/dist/.setup/{approval-handler.runtime-DbPxvynk.cjs → approval-handler.runtime-C16UvawQ.cjs} +6 -5
- package/dist/.setup/{bot-framework-service-url-CgVuKiIR.cjs → bot-framework-service-url-B3FWn2SV.cjs} +4 -2
- package/dist/.setup/{channel-DQrXOfhf.cjs → channel-BaTw0JW3.cjs} +44 -26
- package/dist/.setup/{channel.runtime-Du4GPMES.cjs → channel.runtime-Ch2M_-jN.cjs} +25 -17
- package/dist/.setup/{channel.setup--7ko_Kxv.cjs → channel.setup-B9yKGEse.cjs} +17 -11
- package/dist/.setup/{config-schema-BEXDIOC-.cjs → config-schema-3lVZ45cB.cjs} +4 -3
- package/dist/.setup/{conversation-store-state-AVgRyNE9.cjs → conversation-store-state-CVhMM0QY.cjs} +35 -21
- package/dist/.setup/{delegated-state-DhIHahf1.cjs → delegated-state-ilYzKwD8.cjs} +6 -4
- package/dist/.setup/{monitor-CXjIKz7o.cjs → monitor-b0zPpnmW.cjs} +67 -39
- package/dist/.setup/{oauth-BWG6qWCd.cjs → oauth-CUtfkgKE.cjs} +3 -2
- package/dist/.setup/{presentation-CaLawc5j.cjs → presentation-Duoi9Ijn.cjs} +5 -3
- package/dist/.setup/{reaction-types-DOzN5oTl.cjs → reaction-types-C6F6g2nk.cjs} +5 -3
- package/dist/.setup/{resolve-allowlist-Drj1jaq0.cjs → resolve-allowlist-7mIEepXB.cjs} +36 -20
- package/dist/.setup/{rolldown-runtime-CiKaZLfC.cjs → rolldown-runtime-BloeesfJ.cjs} +2 -1
- package/dist/.setup/{runtime-CbKazLGv.cjs → runtime-gZTAuFux.cjs} +2 -1
- package/dist/.setup/{secret-contract-api-DFqDvc_a.cjs → secret-contract-api-D554HIrH.cjs} +2 -1
- package/dist/.setup/{secret-contract-api-YGHrfAT0.cjs → secret-contract-api-r3hRtbBW.cjs} +1 -1
- package/dist/.setup/{send-BRUztzVJ.cjs → send-D1w7a_ip.cjs} +11 -9
- package/dist/.setup/{setup-plugin-api-BHEfter5.cjs → setup-plugin-api-ChovZJU6.cjs} +1 -1
- package/dist/.setup/{thread-session-BUUV1zk_.cjs → thread-session-CeWYiol_.cjs} +5 -3
- package/dist/.setup/{token-config-7K6UbNCo.cjs → token-config-DICiuJWr.cjs} +2 -1
- package/dist/.source-module-urls/7e43ee3ae4faab430a47269c8217f8d99ec60ecd85233f40e81d03efeb543068.json +1 -1
- 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 +2 -1
- package/dist/directory-contract-api.cjs +2 -1
- package/dist/doctor-backup-resources.cjs +3 -2
- package/dist/doctor-contract-api.cjs +15 -9
- package/dist/index.cjs +2 -1
- package/dist/qa-runner-api.cjs +5 -3
- package/dist/runtime-api.cjs +1 -1
- package/dist/secret-contract-api.cjs +1 -1
- package/dist/setup-entry.cjs +4 -3
- package/dist/setup-plugin-api.cjs +1 -1
- package/package.json +4 -4
package/dist/.setup/{conversation-store-state-AVgRyNE9.cjs → conversation-store-state-CVhMM0QY.cjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_bot_framework_service_url = require("./bot-framework-service-url-
|
|
3
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
4
|
-
const require_runtime = require("./runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
|
|
2
|
+
const require_bot_framework_service_url = require("./bot-framework-service-url-B3FWn2SV.cjs");
|
|
3
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
4
|
+
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
5
5
|
require("../runtime-api.cjs");
|
|
6
|
-
const require_delegated_state = require("./delegated-state-
|
|
7
|
-
const require_presentation = require("./presentation-
|
|
8
|
-
const require_channel_setup = require("./channel.setup
|
|
6
|
+
const require_delegated_state = require("./delegated-state-ilYzKwD8.cjs");
|
|
7
|
+
const require_presentation = require("./presentation-Duoi9Ijn.cjs");
|
|
8
|
+
const require_channel_setup = require("./channel.setup-B9yKGEse.cjs");
|
|
9
9
|
let openclaw_plugin_sdk_lazy_runtime = require("openclaw/plugin-sdk/lazy-runtime");
|
|
10
10
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
11
11
|
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
@@ -34,7 +34,7 @@ let openclaw_plugin_sdk_web_media = require("openclaw/plugin-sdk/web-media");
|
|
|
34
34
|
let openclaw_plugin_sdk_dedupe_runtime = require("openclaw/plugin-sdk/dedupe-runtime");
|
|
35
35
|
let openclaw_plugin_sdk_plugin_state_runtime = require("openclaw/plugin-sdk/plugin-state-runtime");
|
|
36
36
|
let openclaw_plugin_sdk_media_runtime = require("openclaw/plugin-sdk/media-runtime");
|
|
37
|
-
|
|
37
|
+
//#region extensions/msteams/src/file-consent.ts
|
|
38
38
|
/**
|
|
39
39
|
* Allowlist of domains that are valid targets for file consent uploads.
|
|
40
40
|
* These are the Microsoft/SharePoint domains that Teams legitimately provides
|
|
@@ -126,7 +126,8 @@ async function uploadToConsentUrl(params) {
|
|
|
126
126
|
await res.body?.cancel().catch(() => void 0);
|
|
127
127
|
if (!res.ok) throw new Error(`File upload to consent URL failed: ${res.status} ${res.statusText}`);
|
|
128
128
|
}
|
|
129
|
-
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region extensions/msteams/src/pending-uploads-fs.ts
|
|
130
131
|
/** TTL for persisted pending uploads (matches in-memory store). */
|
|
131
132
|
const PENDING_UPLOAD_TTL_MS$1 = 3e5;
|
|
132
133
|
/** Cap to avoid unbounded growth if a process crashes mid-flow. */
|
|
@@ -287,7 +288,8 @@ async function setPendingUploadActivityIdFs(id, activityId) {
|
|
|
287
288
|
});
|
|
288
289
|
});
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
+
//#endregion
|
|
292
|
+
//#region extensions/msteams/src/pending-uploads.ts
|
|
291
293
|
/**
|
|
292
294
|
* In-memory storage for files awaiting user consent in the FileConsentCard flow.
|
|
293
295
|
*
|
|
@@ -344,7 +346,8 @@ function setPendingUploadActivityId(uploadId, activityId) {
|
|
|
344
346
|
const entry = pendingUploads.get(uploadId)?.upload;
|
|
345
347
|
if (entry) entry.consentCardActivityId = activityId;
|
|
346
348
|
}
|
|
347
|
-
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region extensions/msteams/src/file-consent-helpers.ts
|
|
348
351
|
const FILE_CONSENT_THRESHOLD_BYTES = 4194304;
|
|
349
352
|
/** In-process replies keep consent bytes in memory; CLI sends use the persisted variant below. */
|
|
350
353
|
function prepareFileConsentActivity(params) {
|
|
@@ -384,7 +387,8 @@ function requiresFileConsent(params) {
|
|
|
384
387
|
const isLargeFile = params.bufferSize >= FILE_CONSENT_THRESHOLD_BYTES;
|
|
385
388
|
return isPersonal && (isLargeFile || !isImage);
|
|
386
389
|
}
|
|
387
|
-
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region extensions/msteams/src/format.ts
|
|
388
392
|
const ESCAPED_MARKDOWN_RE = /\\[\\`*_{}[\]()#+\-.!|>~]/gu;
|
|
389
393
|
const MARKDOWN_ENTITY_RE = /&(?:#\d+|#x[\da-f]+|[a-z][a-z\d]+);/giu;
|
|
390
394
|
const TOKEN_END = "";
|
|
@@ -654,7 +658,8 @@ function formatMSTeamsMarkdown(markdown, tableMode) {
|
|
|
654
658
|
}, MSTEAMS_FORMAT_CAPABILITIES);
|
|
655
659
|
return protectedValues.reduce((text, { prefix, values }) => restoreTokens(text, prefix, values), restoreTokens(rendered, `${tokenPrefix}c`, codeRegions));
|
|
656
660
|
}
|
|
657
|
-
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region extensions/msteams/src/graph-chat.ts
|
|
658
663
|
function buildTeamsFileInfoCard(file) {
|
|
659
664
|
const rawETag = file.eTag;
|
|
660
665
|
const uniqueId = rawETag.replace(/^["']|["']$/g, "").replace(/[{}]/g, "").split(",")[0] ?? rawETag;
|
|
@@ -667,7 +672,8 @@ function buildTeamsFileInfoCard(file) {
|
|
|
667
672
|
fileType
|
|
668
673
|
});
|
|
669
674
|
}
|
|
670
|
-
|
|
675
|
+
//#endregion
|
|
676
|
+
//#region extensions/msteams/src/graph-upload.ts
|
|
671
677
|
const GRAPH_ROOT = "https://graph.microsoft.com/v1.0";
|
|
672
678
|
const GRAPH_BETA = "https://graph.microsoft.com/beta";
|
|
673
679
|
const GRAPH_SCOPE = "https://graph.microsoft.com";
|
|
@@ -775,7 +781,8 @@ async function uploadAndShareSharePoint(params) {
|
|
|
775
781
|
});
|
|
776
782
|
return { itemId };
|
|
777
783
|
}
|
|
778
|
-
|
|
784
|
+
//#endregion
|
|
785
|
+
//#region extensions/msteams/src/media-helpers.ts
|
|
779
786
|
const MSTEAMS_MAX_MEDIA_BYTES = 104857600;
|
|
780
787
|
async function getMimeType(url) {
|
|
781
788
|
if (url.startsWith("data:")) {
|
|
@@ -820,7 +827,8 @@ function extractMessageId(response) {
|
|
|
820
827
|
const { id } = response;
|
|
821
828
|
return typeof id === "string" && id ? id : null;
|
|
822
829
|
}
|
|
823
|
-
|
|
830
|
+
//#endregion
|
|
831
|
+
//#region extensions/msteams/src/message-activity.ts
|
|
824
832
|
/**
|
|
825
833
|
* Check whether an ID looks like a valid Teams user/bot identifier.
|
|
826
834
|
* Accepts:
|
|
@@ -880,7 +888,8 @@ function buildMSTeamsAdaptiveCardActivity(card) {
|
|
|
880
888
|
}]
|
|
881
889
|
};
|
|
882
890
|
}
|
|
883
|
-
|
|
891
|
+
//#endregion
|
|
892
|
+
//#region extensions/msteams/src/sent-message-cache.ts
|
|
884
893
|
const TTL_MS = 864e5;
|
|
885
894
|
const MAX_ENTRIES = 2e4;
|
|
886
895
|
const PERSISTENT_MAX_ENTRIES = 1e3;
|
|
@@ -929,7 +938,8 @@ async function wasMSTeamsMessageSentWithPersistence(params) {
|
|
|
929
938
|
if (!params.conversationId || !params.messageId) return false;
|
|
930
939
|
return await getSentMessageCache((0, openclaw_plugin_sdk_account_id.normalizeAccountId)(params.accountId)).lookup(makeKey(params.conversationId, params.messageId, params.botId));
|
|
931
940
|
}
|
|
932
|
-
|
|
941
|
+
//#endregion
|
|
942
|
+
//#region extensions/msteams/src/sdk-proactive.ts
|
|
933
943
|
const loadMSTeamsApiModule = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeModule)(() => import("@microsoft/teams.api"));
|
|
934
944
|
async function quoteMSTeamsActivity(activity, messageId) {
|
|
935
945
|
const { MessageActivityInput } = await loadMSTeamsApiModule();
|
|
@@ -1038,7 +1048,8 @@ async function deleteMSTeamsActivityWithReference(app, source, activityId, optio
|
|
|
1038
1048
|
const ref = buildSdkConversationReference(source, options);
|
|
1039
1049
|
return getApiClientForReference(app, ref).conversations.activities(ref.conversation.id).delete(activityId);
|
|
1040
1050
|
}
|
|
1041
|
-
|
|
1051
|
+
//#endregion
|
|
1052
|
+
//#region extensions/msteams/src/messenger.ts
|
|
1042
1053
|
const MSTEAMS_SEND_ATTEMPTS = 3;
|
|
1043
1054
|
const MSTEAMS_SEND_RETRY_MAX_DELAY_MS = 1e4;
|
|
1044
1055
|
function buildConversationReference(ref) {
|
|
@@ -1234,7 +1245,8 @@ async function sendMSTeamsMessages(params) {
|
|
|
1234
1245
|
for (const [idx, message] of messages.entries()) messageIds.push(await sendMessageInContext(sendFn, message, idx));
|
|
1235
1246
|
return messageIds;
|
|
1236
1247
|
}
|
|
1237
|
-
|
|
1248
|
+
//#endregion
|
|
1249
|
+
//#region extensions/msteams/src/polls.ts
|
|
1238
1250
|
const MSTEAMS_POLLS_NAMESPACE = "polls";
|
|
1239
1251
|
const MSTEAMS_POLL_VOTE_BUCKETS_NAMESPACE = "poll-vote-buckets";
|
|
1240
1252
|
const MSTEAMS_MAX_POLLS = 1e3;
|
|
@@ -1466,7 +1478,8 @@ function createMSTeamsPollStoreState(params) {
|
|
|
1466
1478
|
recordVote
|
|
1467
1479
|
};
|
|
1468
1480
|
}
|
|
1469
|
-
|
|
1481
|
+
//#endregion
|
|
1482
|
+
//#region extensions/msteams/src/conversation-store-state.ts
|
|
1470
1483
|
const MSTEAMS_CONVERSATIONS_NAMESPACE = "conversations";
|
|
1471
1484
|
const MSTEAMS_MAX_CONVERSATIONS = 1e3;
|
|
1472
1485
|
const MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS = 2e3;
|
|
@@ -1579,6 +1592,7 @@ function createMSTeamsConversationStoreState(params) {
|
|
|
1579
1592
|
findPreferredDmByUserId
|
|
1580
1593
|
};
|
|
1581
1594
|
}
|
|
1595
|
+
//#endregion
|
|
1582
1596
|
Object.defineProperty(exports, "MSTEAMS_MAX_MEDIA_BYTES", {
|
|
1583
1597
|
enumerable: true,
|
|
1584
1598
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_rolldown_runtime = require("./rolldown-runtime-
|
|
2
|
-
const require_runtime = require("./runtime-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-BloeesfJ.cjs");
|
|
2
|
+
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
3
3
|
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
4
4
|
let node_crypto = require("node:crypto");
|
|
5
5
|
let node_util = require("node:util");
|
|
@@ -7,7 +7,7 @@ let node_path = require("node:path");
|
|
|
7
7
|
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
8
8
|
let openclaw_plugin_sdk_keyed_async_queue = require("openclaw/plugin-sdk/keyed-async-queue");
|
|
9
9
|
let openclaw_plugin_sdk_node_crypto_runtime = require("openclaw/plugin-sdk/node-crypto-runtime");
|
|
10
|
-
|
|
10
|
+
//#region extensions/msteams/src/sqlite-state.ts
|
|
11
11
|
function resolveMSTeamsAccountStateNamespace(namespace, accountId) {
|
|
12
12
|
const normalizedAccountId = (0, openclaw_plugin_sdk_account_id.normalizeAccountId)(accountId);
|
|
13
13
|
if (normalizedAccountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID) return namespace;
|
|
@@ -22,7 +22,8 @@ async function withMSTeamsSqliteMutationLock(mutationKey, fn) {
|
|
|
22
22
|
const scopedMutationKey = node_path.default.join(require_runtime.getMSTeamsRuntime().state.resolveStateDir(), mutationKey);
|
|
23
23
|
return await sqliteMutationLocks.enqueue(scopedMutationKey, fn);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region extensions/msteams/src/delegated-state.ts
|
|
26
27
|
const MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME = "msteams-delegated.json";
|
|
27
28
|
const MSTEAMS_DELEGATED_TOKEN_NAMESPACE = "delegated-token";
|
|
28
29
|
const MSTEAMS_DELEGATED_TOKEN_KEY = "current";
|
|
@@ -102,6 +103,7 @@ async function saveMSTeamsDelegatedTokens(tokens, accountId) {
|
|
|
102
103
|
if (!normalized) throw new Error("Invalid Microsoft Teams delegated token payload");
|
|
103
104
|
await openDelegatedTokenStore(accountId).register(MSTEAMS_DELEGATED_TOKEN_KEY, normalized);
|
|
104
105
|
}
|
|
106
|
+
//#endregion
|
|
105
107
|
Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_KEY", {
|
|
106
108
|
enumerable: true,
|
|
107
109
|
get: function() {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const require_bot_framework_service_url = require("./bot-framework-service-url-
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
3
|
-
const require_runtime = require("./runtime-
|
|
1
|
+
const require_bot_framework_service_url = require("./bot-framework-service-url-B3FWn2SV.cjs");
|
|
2
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
3
|
+
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
4
4
|
require("../runtime-api.cjs");
|
|
5
|
-
const require_delegated_state = require("./delegated-state-
|
|
6
|
-
const require_channel = require("./channel-
|
|
7
|
-
const require_presentation = require("./presentation-
|
|
8
|
-
const require_thread_session = require("./thread-session-
|
|
9
|
-
const require_channel_setup = require("./channel.setup
|
|
10
|
-
const require_approval_card = require("./approval-card-
|
|
11
|
-
const require_conversation_store_state = require("./conversation-store-state-
|
|
12
|
-
const require_reaction_types = require("./reaction-types-
|
|
5
|
+
const require_delegated_state = require("./delegated-state-ilYzKwD8.cjs");
|
|
6
|
+
const require_channel = require("./channel-BaTw0JW3.cjs");
|
|
7
|
+
const require_presentation = require("./presentation-Duoi9Ijn.cjs");
|
|
8
|
+
const require_thread_session = require("./thread-session-CeWYiol_.cjs");
|
|
9
|
+
const require_channel_setup = require("./channel.setup-B9yKGEse.cjs");
|
|
10
|
+
const require_approval_card = require("./approval-card-BHAKsdAM.cjs");
|
|
11
|
+
const require_conversation_store_state = require("./conversation-store-state-CVhMM0QY.cjs");
|
|
12
|
+
const require_reaction_types = require("./reaction-types-C6F6g2nk.cjs");
|
|
13
13
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
14
14
|
let openclaw_plugin_sdk_interactive_runtime = require("openclaw/plugin-sdk/interactive-runtime");
|
|
15
15
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
@@ -44,7 +44,7 @@ let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runt
|
|
|
44
44
|
let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
|
|
45
45
|
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
46
46
|
let openclaw_plugin_sdk_webhook_ingress = require("openclaw/plugin-sdk/webhook-ingress");
|
|
47
|
-
|
|
47
|
+
//#region extensions/msteams/src/adaptive-card-submit.ts
|
|
48
48
|
function extractAdaptiveCardSubmittedData(value) {
|
|
49
49
|
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return value;
|
|
50
50
|
const action = (0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value.action) ? value.action : void 0;
|
|
@@ -72,7 +72,8 @@ function serializeMSTeamsAdaptiveCardActionValue(value) {
|
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region extensions/msteams/src/approval-card-submit.ts
|
|
76
77
|
function isMSTeamsApprovalSubmit(value) {
|
|
77
78
|
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return false;
|
|
78
79
|
if (value.openclawAction === "approval") return true;
|
|
@@ -156,7 +157,8 @@ async function maybeHandleMSTeamsApprovalCardSubmit(params) {
|
|
|
156
157
|
});
|
|
157
158
|
return true;
|
|
158
159
|
}
|
|
159
|
-
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region extensions/msteams/src/monitor-handler/access.ts
|
|
160
162
|
const msteamsIngressIdentity = {
|
|
161
163
|
key: "sender-id",
|
|
162
164
|
authentication: "asserted",
|
|
@@ -432,7 +434,8 @@ async function admitMSTeamsMessage(params) {
|
|
|
432
434
|
isChannel: params.isChannel
|
|
433
435
|
};
|
|
434
436
|
}
|
|
435
|
-
|
|
437
|
+
//#endregion
|
|
438
|
+
//#region src/channels/mention-gating.ts
|
|
436
439
|
function resolveBotThreadMentionPolicy(params) {
|
|
437
440
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
438
441
|
requireMention: params.requireMention,
|
|
@@ -443,7 +446,8 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
443
446
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
444
447
|
};
|
|
445
448
|
}
|
|
446
|
-
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region extensions/msteams/src/informative-status.ts
|
|
447
451
|
const INFORMATIVE_MAX_CHARS = 1e3;
|
|
448
452
|
const INFORMATIVE_MAX_BYTES = 1024;
|
|
449
453
|
const ELLIPSIS = "…";
|
|
@@ -466,7 +470,8 @@ function flattenInformativeStatus(text) {
|
|
|
466
470
|
}
|
|
467
471
|
return ELLIPSIS + graphemes.slice(start).join("");
|
|
468
472
|
}
|
|
469
|
-
|
|
473
|
+
//#endregion
|
|
474
|
+
//#region extensions/msteams/src/reply-stream-controller.ts
|
|
470
475
|
function hasUnstreamedContent(payload) {
|
|
471
476
|
return Boolean(payload.presentation || payload.mediaUrl || payload.mediaUrls?.length);
|
|
472
477
|
}
|
|
@@ -733,7 +738,8 @@ function createTeamsReplyStreamController(params) {
|
|
|
733
738
|
wasCanceled
|
|
734
739
|
};
|
|
735
740
|
}
|
|
736
|
-
|
|
741
|
+
//#endregion
|
|
742
|
+
//#region extensions/msteams/src/reply-dispatcher.ts
|
|
737
743
|
function createMSTeamsReplyDispatcher(params) {
|
|
738
744
|
const core = require_runtime.getMSTeamsRuntime();
|
|
739
745
|
const msteamsCfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(params.cfg, params.accountId);
|
|
@@ -1046,7 +1052,8 @@ function createMSTeamsReplyDispatcher(params) {
|
|
|
1046
1052
|
}
|
|
1047
1053
|
};
|
|
1048
1054
|
}
|
|
1049
|
-
|
|
1055
|
+
//#endregion
|
|
1056
|
+
//#region extensions/msteams/src/team-identity.ts
|
|
1050
1057
|
const teamGroupIdCache = /* @__PURE__ */ new Map();
|
|
1051
1058
|
const TEAM_GROUP_ID_CACHE_MAX_ENTRIES = 500;
|
|
1052
1059
|
function cacheTeamGroupId(conversationTeamId, groupId) {
|
|
@@ -1073,7 +1080,8 @@ async function resolveTeamGroupId(params) {
|
|
|
1073
1080
|
cacheTeamGroupId(params.conversationTeamId, groupId);
|
|
1074
1081
|
return groupId;
|
|
1075
1082
|
}
|
|
1076
|
-
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region extensions/msteams/src/monitor-handler/config.ts
|
|
1077
1085
|
function createMSTeamsHandlerConfigReader(deps) {
|
|
1078
1086
|
const source = deps.accountPolicyCfg ?? deps.cfg;
|
|
1079
1087
|
const read = (0, openclaw_plugin_sdk_runtime_config_snapshot.createRuntimeConfigReader)(source);
|
|
@@ -1098,7 +1106,8 @@ function createMSTeamsHandlerConfigReader(deps) {
|
|
|
1098
1106
|
});
|
|
1099
1107
|
};
|
|
1100
1108
|
}
|
|
1101
|
-
|
|
1109
|
+
//#endregion
|
|
1110
|
+
//#region extensions/msteams/src/attachments/bot-framework.ts
|
|
1102
1111
|
const BOT_FRAMEWORK_SCOPE = "https://api.botframework.com";
|
|
1103
1112
|
/**
|
|
1104
1113
|
* Detect Bot Framework personal chat ("a:") and MSA orgid ("8:orgid:") conversation
|
|
@@ -1258,7 +1267,8 @@ async function downloadMSTeamsBotFrameworkAttachments(params) {
|
|
|
1258
1267
|
attachmentCount: unique.length
|
|
1259
1268
|
};
|
|
1260
1269
|
}
|
|
1261
|
-
|
|
1270
|
+
//#endregion
|
|
1271
|
+
//#region extensions/msteams/src/attachments/html.ts
|
|
1262
1272
|
function collectHtmlAttachmentIds(html, ids) {
|
|
1263
1273
|
for (const value of require_resolve_allowlist.htmlTagAttributeValues(html, "attachment", "id")) {
|
|
1264
1274
|
const id = value.trim();
|
|
@@ -1342,7 +1352,8 @@ function resolveMSTeamsAdvertisedMedia(attachments) {
|
|
|
1342
1352
|
...htmlAttachmentIds.map((sourceId) => createAdvertisedMediaFact("document", sourceId))
|
|
1343
1353
|
];
|
|
1344
1354
|
}
|
|
1345
|
-
|
|
1355
|
+
//#endregion
|
|
1356
|
+
//#region extensions/msteams/src/attachments/remote-media.ts
|
|
1346
1357
|
/**
|
|
1347
1358
|
* Direct save path used when the caller supplies the already-guarded fetch
|
|
1348
1359
|
* implementation. This lets Teams-specific auth fallback own the request
|
|
@@ -1369,7 +1380,8 @@ async function downloadAndStoreMSTeamsRemoteMedia(params) {
|
|
|
1369
1380
|
await response.body?.cancel().catch(() => void 0);
|
|
1370
1381
|
}
|
|
1371
1382
|
}
|
|
1372
|
-
|
|
1383
|
+
//#endregion
|
|
1384
|
+
//#region extensions/msteams/src/attachments/download.ts
|
|
1373
1385
|
function resolveDownloadCandidate(att, graphReferenceToken) {
|
|
1374
1386
|
const contentType = require_resolve_allowlist.normalizeContentType(att.contentType);
|
|
1375
1387
|
const graphReference = graphReferenceToken !== void 0 && contentType === "reference";
|
|
@@ -1583,7 +1595,8 @@ async function downloadMSTeamsAttachments(params) {
|
|
|
1583
1595
|
function safeHostForLog(url) {
|
|
1584
1596
|
return URL.parse(url)?.host ?? "invalid-url";
|
|
1585
1597
|
}
|
|
1586
|
-
|
|
1598
|
+
//#endregion
|
|
1599
|
+
//#region extensions/msteams/src/attachments/graph.ts
|
|
1587
1600
|
function createGraphHostedContentFact(item) {
|
|
1588
1601
|
const contentType = require_resolve_allowlist.normalizeContentType(item.contentType);
|
|
1589
1602
|
return {
|
|
@@ -1798,7 +1811,8 @@ async function downloadMSTeamsGraphMedia(params) {
|
|
|
1798
1811
|
attachmentStatus: messageStatus
|
|
1799
1812
|
};
|
|
1800
1813
|
}
|
|
1801
|
-
|
|
1814
|
+
//#endregion
|
|
1815
|
+
//#region extensions/msteams/src/monitor-handler/inbound-content.ts
|
|
1802
1816
|
async function prepareMSTeamsInboundContent(params) {
|
|
1803
1817
|
const activity = params.entry.context.activity;
|
|
1804
1818
|
const mayRecoverGraphMedia = Boolean(params.htmlSummary?.attachmentIds.length) || shouldAttemptMSTeamsGraphMediaFallback({
|
|
@@ -1963,7 +1977,8 @@ function mergeMSTeamsMediaFacts(nativeMedia, materializedMedia, options = {}) {
|
|
|
1963
1977
|
function hasMaterializedMedia(media) {
|
|
1964
1978
|
return media.some((entry) => Boolean(entry.path));
|
|
1965
1979
|
}
|
|
1966
|
-
|
|
1980
|
+
//#endregion
|
|
1981
|
+
//#region extensions/msteams/src/monitor-handler/inbound-facts.ts
|
|
1967
1982
|
function extractTextFromHtmlAttachments(attachments, activity) {
|
|
1968
1983
|
for (const attachment of attachments) {
|
|
1969
1984
|
const raw = require_resolve_allowlist.extractHtmlFromAttachment(attachment);
|
|
@@ -2053,7 +2068,8 @@ function assembleMSTeamsInboundFacts(entry) {
|
|
|
2053
2068
|
conversationRef
|
|
2054
2069
|
};
|
|
2055
2070
|
}
|
|
2056
|
-
|
|
2071
|
+
//#endregion
|
|
2072
|
+
//#region extensions/msteams/src/thread-parent-context.ts
|
|
2057
2073
|
const PARENT_CACHE_TTL_MS = 3e5;
|
|
2058
2074
|
const PARENT_CACHE_MAX = 100;
|
|
2059
2075
|
const parentCache = /* @__PURE__ */ new Map();
|
|
@@ -2100,7 +2116,8 @@ function shouldInjectParentContext(sessionKey, parentId) {
|
|
|
2100
2116
|
function markParentContextInjected(sessionKey, parentId) {
|
|
2101
2117
|
touchLru(injectedParents, sessionKey, parentId, INJECTED_MAX);
|
|
2102
2118
|
}
|
|
2103
|
-
|
|
2119
|
+
//#endregion
|
|
2120
|
+
//#region extensions/msteams/src/monitor-handler/thread-context.ts
|
|
2104
2121
|
async function resolveMSTeamsThreadContext(params) {
|
|
2105
2122
|
const core = require_runtime.getMSTeamsRuntime();
|
|
2106
2123
|
const activity = params.context.activity;
|
|
@@ -2182,7 +2199,8 @@ async function resolveMSTeamsThreadContext(params) {
|
|
|
2182
2199
|
threadContext
|
|
2183
2200
|
};
|
|
2184
2201
|
}
|
|
2185
|
-
|
|
2202
|
+
//#endregion
|
|
2203
|
+
//#region extensions/msteams/src/monitor-handler/message-handler.ts
|
|
2186
2204
|
function createMSTeamsMessageHandler(deps) {
|
|
2187
2205
|
const { cfg, accountPolicyCfg = cfg, accountId, runtime, appId, app, tokenProvider, textLimit, mediaMaxBytes, conversationStore, pollStore, log } = deps;
|
|
2188
2206
|
const core = require_runtime.getMSTeamsRuntime();
|
|
@@ -2688,7 +2706,8 @@ function createMSTeamsMessageHandler(deps) {
|
|
|
2688
2706
|
if (turnAdoptionLifecycle) return { kind: "deferred" };
|
|
2689
2707
|
};
|
|
2690
2708
|
}
|
|
2691
|
-
|
|
2709
|
+
//#endregion
|
|
2710
|
+
//#region extensions/msteams/src/monitor-handler/reaction-handler.ts
|
|
2692
2711
|
function createMSTeamsReactionHandler(deps) {
|
|
2693
2712
|
const { accountId, log } = deps;
|
|
2694
2713
|
const readConfig = deps.readConfig ?? createMSTeamsHandlerConfigReader(deps);
|
|
@@ -2770,7 +2789,8 @@ function createMSTeamsReactionHandler(deps) {
|
|
|
2770
2789
|
}
|
|
2771
2790
|
};
|
|
2772
2791
|
}
|
|
2773
|
-
|
|
2792
|
+
//#endregion
|
|
2793
|
+
//#region extensions/msteams/src/monitor-handler.ts
|
|
2774
2794
|
const DEFAULT_PROMPT_STARTERS = [
|
|
2775
2795
|
"What can you do?",
|
|
2776
2796
|
"Summarize my last meeting",
|
|
@@ -2913,7 +2933,8 @@ function createMSTeamsActivityHandler(deps) {
|
|
|
2913
2933
|
}
|
|
2914
2934
|
};
|
|
2915
2935
|
}
|
|
2916
|
-
|
|
2936
|
+
//#endregion
|
|
2937
|
+
//#region extensions/msteams/src/feedback-invoke.ts
|
|
2917
2938
|
/** Return whether feedback consumed the invoke; the SDK owns its HTTP acknowledgement. */
|
|
2918
2939
|
async function runMSTeamsFeedbackInvokeHandler(context, deps) {
|
|
2919
2940
|
const activity = context.activity;
|
|
@@ -3065,7 +3086,8 @@ async function runMSTeamsFeedbackInvokeHandler(context, deps) {
|
|
|
3065
3086
|
}
|
|
3066
3087
|
return true;
|
|
3067
3088
|
}
|
|
3068
|
-
|
|
3089
|
+
//#endregion
|
|
3090
|
+
//#region extensions/msteams/src/file-consent-invoke.ts
|
|
3069
3091
|
/** Run delayed upload/update work after the SDK route acknowledges the invoke. */
|
|
3070
3092
|
async function runMSTeamsFileConsentInvokeHandler(context, log) {
|
|
3071
3093
|
try {
|
|
@@ -3142,7 +3164,8 @@ async function runMSTeamsFileConsentInvokeHandler(context, log) {
|
|
|
3142
3164
|
log.debug?.("file consent handler error", { error: require_channel_setup.formatUnknownError(err) });
|
|
3143
3165
|
}
|
|
3144
3166
|
}
|
|
3145
|
-
|
|
3167
|
+
//#endregion
|
|
3168
|
+
//#region extensions/msteams/src/msteams-ingress.ts
|
|
3146
3169
|
const MSTEAMS_INGRESS_VERSION = 1;
|
|
3147
3170
|
const MSTEAMS_INGRESS_DRAIN_INTERVAL_MS = 500;
|
|
3148
3171
|
const MSTEAMS_INGRESS_MAX_CONCURRENT_DELIVERIES = 8;
|
|
@@ -3271,7 +3294,8 @@ function createMSTeamsIngress(options) {
|
|
|
3271
3294
|
}
|
|
3272
3295
|
};
|
|
3273
3296
|
}
|
|
3274
|
-
|
|
3297
|
+
//#endregion
|
|
3298
|
+
//#region extensions/msteams/src/replay-context.ts
|
|
3275
3299
|
function createMSTeamsReplayContext(activity, app, serviceUrlBoundary, accountId) {
|
|
3276
3300
|
const rawConversationId = activity.conversation?.id ?? "";
|
|
3277
3301
|
const conversationId = require_resolve_allowlist.normalizeMSTeamsConversationId(rawConversationId);
|
|
@@ -3311,7 +3335,8 @@ function createMSTeamsReplayContext(activity, app, serviceUrlBoundary, accountId
|
|
|
3311
3335
|
getTeamDetails: (teamId) => app.api.teams.getById(teamId)
|
|
3312
3336
|
};
|
|
3313
3337
|
}
|
|
3314
|
-
|
|
3338
|
+
//#endregion
|
|
3339
|
+
//#region extensions/msteams/src/sso-token-store.ts
|
|
3315
3340
|
/**
|
|
3316
3341
|
* SQLite-backed store for Bot Framework OAuth SSO tokens.
|
|
3317
3342
|
*
|
|
@@ -3343,7 +3368,8 @@ function createMSTeamsSsoTokenStoreFs(params) {
|
|
|
3343
3368
|
}
|
|
3344
3369
|
};
|
|
3345
3370
|
}
|
|
3346
|
-
|
|
3371
|
+
//#endregion
|
|
3372
|
+
//#region extensions/msteams/src/webhook-handler.ts
|
|
3347
3373
|
/** Keep Express response ownership until the channel's route can be released. */
|
|
3348
3374
|
function createMSTeamsWebhookHandler(expressApp, warn) {
|
|
3349
3375
|
const responses = /* @__PURE__ */ new Map();
|
|
@@ -3385,7 +3411,8 @@ function createMSTeamsWebhookHandler(expressApp, warn) {
|
|
|
3385
3411
|
}
|
|
3386
3412
|
};
|
|
3387
3413
|
}
|
|
3388
|
-
|
|
3414
|
+
//#endregion
|
|
3415
|
+
//#region extensions/msteams/src/monitor.ts
|
|
3389
3416
|
async function monitorMSTeamsProvider(opts) {
|
|
3390
3417
|
const core = require_runtime.getMSTeamsRuntime();
|
|
3391
3418
|
const log = core.logging.getChildLogger({ name: "msteams" });
|
|
@@ -3819,4 +3846,5 @@ function adaptSdkContext(ctx, app) {
|
|
|
3819
3846
|
stream: sdkCtx.stream
|
|
3820
3847
|
});
|
|
3821
3848
|
}
|
|
3849
|
+
//#endregion
|
|
3822
3850
|
exports.monitorMSTeamsProvider = monitorMSTeamsProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
|
|
4
|
+
//#region extensions/msteams/src/oauth.ts
|
|
5
5
|
async function loginMSTeamsDelegated(ctx, params) {
|
|
6
6
|
await ctx.note([
|
|
7
7
|
"You are running in a remote/VPS environment.",
|
|
@@ -40,4 +40,5 @@ async function loginMSTeamsDelegated(ctx, params) {
|
|
|
40
40
|
verifier
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
//#endregion
|
|
43
44
|
exports.loginMSTeamsDelegated = loginMSTeamsDelegated;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
2
2
|
require("../runtime-api.cjs");
|
|
3
3
|
let openclaw_plugin_sdk_channel_policy = require("openclaw/plugin-sdk/channel-policy");
|
|
4
4
|
let openclaw_plugin_sdk_interactive_runtime = require("openclaw/plugin-sdk/interactive-runtime");
|
|
5
5
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
6
6
|
let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
|
|
7
|
-
|
|
7
|
+
//#region extensions/msteams/src/policy.ts
|
|
8
8
|
function matchMSTeamsPolicyEntry(entries, ...keys) {
|
|
9
9
|
return (0, openclaw_plugin_sdk_channel_targets.resolveChannelEntryMatchWithFallback)({
|
|
10
10
|
entries,
|
|
@@ -85,7 +85,8 @@ function resolveMSTeamsReplyPolicy(params) {
|
|
|
85
85
|
...requireMentionInBotThreads === void 0 ? {} : { requireMentionInBotThreads }
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region extensions/msteams/src/presentation.ts
|
|
89
90
|
const MSTEAMS_PRESENTATION_CAPABILITIES = {
|
|
90
91
|
supported: true,
|
|
91
92
|
buttons: true,
|
|
@@ -179,6 +180,7 @@ function buildMSTeamsPresentationCard(params) {
|
|
|
179
180
|
...actions.length ? { actions } : {}
|
|
180
181
|
};
|
|
181
182
|
}
|
|
183
|
+
//#endregion
|
|
182
184
|
Object.defineProperty(exports, "MSTEAMS_PRESENTATION_CAPABILITIES", {
|
|
183
185
|
enumerable: true,
|
|
184
186
|
get: function() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
2
|
-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-7mIEepXB.cjs");
|
|
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;
|
|
5
5
|
function compareThreadMessagesChronologically(a, b) {
|
|
@@ -88,7 +88,8 @@ function buildThreadContext(messages, currentMessageId) {
|
|
|
88
88
|
}
|
|
89
89
|
return context;
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region extensions/msteams/src/reaction-types.ts
|
|
92
93
|
const TEAMS_REACTION_EMOJI = {
|
|
93
94
|
like: "👍",
|
|
94
95
|
heart: "❤️",
|
|
@@ -107,6 +108,7 @@ function resolveMSTeamsReactionEmoji(raw) {
|
|
|
107
108
|
if (!normalized) throw new Error(`Reaction type is required. Common types: ${TEAMS_REACTION_TYPES.join(", ")}`);
|
|
108
109
|
return getMSTeamsReactionEmoji(normalized) ?? normalized;
|
|
109
110
|
}
|
|
111
|
+
//#endregion
|
|
110
112
|
Object.defineProperty(exports, "buildThreadContext", {
|
|
111
113
|
enumerable: true,
|
|
112
114
|
get: function() {
|