@openclaw/msteams 2026.8.1-beta.2 → 2026.9.1-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/{adapter.runtime-DEYjslFX.cjs → adapter.runtime-8g-MOPfb.cjs} +4 -2
- package/dist/api.cjs +6 -6
- package/dist/approval-card-B6ZIMO83.cjs +303 -0
- package/dist/approval-handler.runtime-C3FXQ_6Z.cjs +107 -0
- package/dist/{channel-DfCbi0d_.cjs → channel-BsqcQ0E9.cjs} +174 -106
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/{channel.runtime-BJmueA4q.cjs → channel.runtime-DuQWuKFd.cjs} +38 -598
- package/dist/{setup-surface-DAhGL2h8.cjs → channel.setup-BvYxZIFG.cjs} +89 -36
- package/dist/configured-state.cjs +20 -0
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/{messenger-BqA8G3pY.cjs → messenger-BJB30CC2.cjs} +46 -188
- package/dist/{oauth-DktsbN22.cjs → oauth-BXQBTEta.cjs} +2 -2
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/reaction-types-dGkp4bkW.cjs +149 -0
- package/dist/{resolve-allowlist-C6YcNC9a.cjs → resolve-allowlist-B6FQAa3r.cjs} +71 -68
- package/dist/runtime-api.cjs +1 -1
- package/dist/secret-input-C65t6kjM.cjs +1 -0
- package/dist/send-S0VPVSUi.cjs +627 -0
- package/dist/setup-plugin-api.cjs +2 -36
- package/dist/{src-Bz9wY0Mr.cjs → src-NMnaP_95.cjs} +221 -106
- package/dist/thread-session-DdWfgc8U.cjs +63 -0
- package/package.json +13 -11
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
require("./runtime-api.cjs");
|
|
2
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
2
|
+
const require_resolve_allowlist = require("./resolve-allowlist-B6FQAa3r.cjs");
|
|
3
|
+
const require_directory_contract_api = require("./directory-contract-api.cjs");
|
|
4
|
+
const require_thread_session = require("./thread-session-DdWfgc8U.cjs");
|
|
5
|
+
const require_channel_setup = require("./channel.setup-BvYxZIFG.cjs");
|
|
6
|
+
let openclaw_plugin_sdk_approval_handler_adapter_runtime = require("openclaw/plugin-sdk/approval-handler-adapter-runtime");
|
|
6
7
|
let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
|
|
7
8
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
8
9
|
let openclaw_plugin_sdk_channel_pairing = require("openclaw/plugin-sdk/channel-pairing");
|
|
9
10
|
let openclaw_plugin_sdk_channel_policy = require("openclaw/plugin-sdk/channel-policy");
|
|
11
|
+
let openclaw_plugin_sdk_channel_runtime_context = require("openclaw/plugin-sdk/channel-runtime-context");
|
|
10
12
|
let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
|
|
11
13
|
let openclaw_plugin_sdk_interactive_runtime = require("openclaw/plugin-sdk/interactive-runtime");
|
|
12
14
|
let openclaw_plugin_sdk_lazy_runtime = require("openclaw/plugin-sdk/lazy-runtime");
|
|
13
15
|
let openclaw_plugin_sdk_status_helpers = require("openclaw/plugin-sdk/status-helpers");
|
|
14
16
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
15
17
|
let typebox = require("typebox");
|
|
18
|
+
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
16
19
|
let openclaw_plugin_sdk_reply_reference = require("openclaw/plugin-sdk/reply-reference");
|
|
17
|
-
let
|
|
20
|
+
let openclaw_plugin_sdk_approval_delivery_runtime = require("openclaw/plugin-sdk/approval-delivery-runtime");
|
|
21
|
+
let openclaw_plugin_sdk_approval_native_runtime = require("openclaw/plugin-sdk/approval-native-runtime");
|
|
18
22
|
let openclaw_plugin_sdk_channel_actions = require("openclaw/plugin-sdk/channel-actions");
|
|
19
|
-
let openclaw_plugin_sdk_routing = require("openclaw/plugin-sdk/routing");
|
|
20
23
|
let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
|
|
21
24
|
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
22
25
|
let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
|
|
23
26
|
let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
|
|
24
27
|
let openclaw_plugin_sdk_text_chunking = require("openclaw/plugin-sdk/text-chunking");
|
|
25
28
|
let openclaw_plugin_sdk_channel_status = require("openclaw/plugin-sdk/channel-status");
|
|
26
|
-
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
27
29
|
//#region extensions/msteams/src/policy.ts
|
|
28
30
|
const teamScopeKey = (teamKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey]);
|
|
29
31
|
const channelScopeKey = (teamKey, channelKey) => (0, openclaw_plugin_sdk_channel_policy.scopeKey)(["team", teamKey], ["channel", channelKey]);
|
|
@@ -250,32 +252,123 @@ function resolveMSTeamsAutoThreadId(params) {
|
|
|
250
252
|
return context.currentThreadTs;
|
|
251
253
|
}
|
|
252
254
|
//#endregion
|
|
253
|
-
//#region extensions/msteams/src/approval-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
return id && MSTEAMS_ID_RE.test(id) ? id : void 0;
|
|
255
|
+
//#region extensions/msteams/src/approval-native.ts
|
|
256
|
+
function isMSTeamsApprovalTransportEnabled(params) {
|
|
257
|
+
if (params.accountId && (0, openclaw_plugin_sdk_account_id.normalizeAccountId)(params.accountId) !== openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID) return false;
|
|
258
|
+
const account = require_channel_setup.resolveMSTeamsAccount(params.cfg);
|
|
259
|
+
return account.enabled && account.configured && account.tokenStatus === "available";
|
|
259
260
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
261
|
+
const msTeamsMessagingTargetResolvers = (0, openclaw_plugin_sdk_approval_native_runtime.createNativeApprovalMessagingTargetResolvers)({
|
|
262
|
+
channel: "msteams",
|
|
263
|
+
normalizeTo: require_resolve_allowlist.normalizeMSTeamsMessagingTarget
|
|
264
|
+
});
|
|
265
|
+
const msTeamsApprovalTargetResolvers = {
|
|
266
|
+
...msTeamsMessagingTargetResolvers,
|
|
267
|
+
resolveTurnSourceTarget: (request) => {
|
|
268
|
+
const target = msTeamsMessagingTargetResolvers.resolveTurnSourceTarget(request);
|
|
269
|
+
return target ? {
|
|
270
|
+
...target,
|
|
271
|
+
threadId: request.request.turnSourceThreadId ?? null
|
|
272
|
+
} : null;
|
|
271
273
|
},
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
resolveSessionTarget: (sessionTarget) => {
|
|
275
|
+
const target = msTeamsMessagingTargetResolvers.resolveSessionTarget(sessionTarget);
|
|
276
|
+
return target ? {
|
|
277
|
+
...target,
|
|
278
|
+
threadId: sessionTarget.threadId ?? null
|
|
279
|
+
} : null;
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
const msTeamsApprovalRouteGates = (0, openclaw_plugin_sdk_approval_native_runtime.createNativeApprovalChannelRouteGates)({
|
|
283
|
+
channel: "msteams",
|
|
284
|
+
defaultForwardingMode: "session",
|
|
285
|
+
isTransportEnabled: isMSTeamsApprovalTransportEnabled,
|
|
286
|
+
listAccountIds: require_channel_setup.msteamsConfigAdapter.listAccountIds,
|
|
287
|
+
resolveDefaultAccountId: () => openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID,
|
|
288
|
+
normalizeForwardTarget: msTeamsApprovalTargetResolvers.normalizeForwardTarget,
|
|
289
|
+
resolveTurnSourceTarget: msTeamsApprovalTargetResolvers.resolveTurnSourceTarget
|
|
290
|
+
});
|
|
291
|
+
function isMSTeamsNativeApprovalClientEnabled(params) {
|
|
292
|
+
return msTeamsApprovalRouteGates.canAnyApprovalPotentiallyRouteToChannel({
|
|
293
|
+
...params,
|
|
294
|
+
nativeSessionOnly: true
|
|
295
|
+
}) && require_thread_session.getMSTeamsApprovalApprovers(params).length > 0;
|
|
296
|
+
}
|
|
297
|
+
function shouldHandleMSTeamsNativeApprovalRequest(params) {
|
|
298
|
+
return msTeamsApprovalRouteGates.shouldHandleApprovalRequest(params) && require_thread_session.getMSTeamsApprovalApprovers(params).length > 0 && Boolean(msTeamsApprovalTargetResolvers.resolveTurnSourceTarget(params.request));
|
|
299
|
+
}
|
|
300
|
+
function shouldSuppressLocalMSTeamsExecApprovalPrompt(params) {
|
|
301
|
+
return (0, openclaw_plugin_sdk_approval_native_runtime.shouldSuppressLocalNativeExecApprovalPrompt)({
|
|
302
|
+
...params,
|
|
303
|
+
isNativeDeliveryEnabled: isMSTeamsNativeApprovalClientEnabled
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
const resolveMSTeamsOriginTarget = (0, openclaw_plugin_sdk_approval_native_runtime.createChannelNativeOriginTargetResolver)({
|
|
307
|
+
channel: "msteams",
|
|
308
|
+
shouldHandleRequest: shouldHandleMSTeamsNativeApprovalRequest,
|
|
309
|
+
resolveTurnSourceTarget: msTeamsApprovalTargetResolvers.resolveTurnSourceTarget,
|
|
310
|
+
resolveSessionTarget: msTeamsApprovalTargetResolvers.resolveSessionTarget,
|
|
311
|
+
normalizeTarget: msTeamsApprovalTargetResolvers.normalizeTarget
|
|
312
|
+
});
|
|
313
|
+
const msTeamsLazyApprovalNativeRuntime = (0, openclaw_plugin_sdk_approval_handler_adapter_runtime.createLazyChannelApprovalNativeRuntimeAdapter)({
|
|
314
|
+
eventKinds: ["exec", "plugin"],
|
|
315
|
+
isConfigured: ({ cfg, accountId }) => isMSTeamsNativeApprovalClientEnabled({
|
|
316
|
+
cfg,
|
|
317
|
+
accountId
|
|
318
|
+
}),
|
|
319
|
+
shouldHandle: ({ cfg, accountId, approvalKind, request }) => shouldHandleMSTeamsNativeApprovalRequest({
|
|
320
|
+
cfg,
|
|
321
|
+
accountId,
|
|
322
|
+
approvalKind,
|
|
323
|
+
request
|
|
324
|
+
}),
|
|
325
|
+
load: async () => {
|
|
326
|
+
const { msTeamsApprovalNativeRuntime } = await Promise.resolve().then(() => require("./approval-handler.runtime-C3FXQ_6Z.cjs"));
|
|
327
|
+
return msTeamsApprovalNativeRuntime;
|
|
277
328
|
}
|
|
278
|
-
})
|
|
329
|
+
});
|
|
330
|
+
const resolveMSTeamsApproverDmTargets = (0, openclaw_plugin_sdk_approval_native_runtime.createChannelApproverDmTargetResolver)({
|
|
331
|
+
shouldHandleRequest: shouldHandleMSTeamsNativeApprovalRequest,
|
|
332
|
+
resolveApprovers: require_thread_session.getMSTeamsApprovalApprovers,
|
|
333
|
+
mapApprover: (approver, params) => ({
|
|
334
|
+
to: `user:${approver}`,
|
|
335
|
+
accountId: (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(params.accountId)
|
|
336
|
+
})
|
|
337
|
+
});
|
|
338
|
+
const msTeamsApprovalCapability = {
|
|
339
|
+
...(0, openclaw_plugin_sdk_approval_delivery_runtime.createApproverRestrictedNativeApprovalCapability)({
|
|
340
|
+
channel: "msteams",
|
|
341
|
+
channelLabel: "Microsoft Teams",
|
|
342
|
+
describeExecApprovalSetup: () => "Approve it from the Web UI or terminal UI for now. Microsoft Teams supports native approvals when the bot is configured. Configure `channels.msteams.allowFrom` or `channels.msteams.defaultTo` with Microsoft Entra object ID approvers.",
|
|
343
|
+
listAccountIds: require_channel_setup.msteamsConfigAdapter.listAccountIds,
|
|
344
|
+
hasApprovers: ({ cfg, accountId }) => require_thread_session.getMSTeamsApprovalApprovers({
|
|
345
|
+
cfg,
|
|
346
|
+
accountId
|
|
347
|
+
}).length > 0,
|
|
348
|
+
isExecAuthorizedSender: ({ cfg, accountId, senderId }) => require_thread_session.msTeamsApprovalAuth.authorizeActorAction?.({
|
|
349
|
+
cfg,
|
|
350
|
+
accountId,
|
|
351
|
+
senderId,
|
|
352
|
+
action: "approve",
|
|
353
|
+
approvalKind: "exec"
|
|
354
|
+
})?.authorized ?? false,
|
|
355
|
+
isPluginAuthorizedSender: ({ cfg, accountId, senderId }) => require_thread_session.msTeamsApprovalAuth.authorizeActorAction?.({
|
|
356
|
+
cfg,
|
|
357
|
+
accountId,
|
|
358
|
+
senderId,
|
|
359
|
+
action: "approve",
|
|
360
|
+
approvalKind: "plugin"
|
|
361
|
+
})?.authorized ?? false,
|
|
362
|
+
isNativeDeliveryEnabled: isMSTeamsNativeApprovalClientEnabled,
|
|
363
|
+
resolveNativeDeliveryMode: () => "channel",
|
|
364
|
+
requireMatchingTurnSourceChannel: true,
|
|
365
|
+
resolveSuppressionAccountId: ({ target, request }) => (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(target.accountId) ?? (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(request.request.turnSourceAccountId),
|
|
366
|
+
resolveOriginTarget: resolveMSTeamsOriginTarget,
|
|
367
|
+
resolveApproverDmTargets: resolveMSTeamsApproverDmTargets,
|
|
368
|
+
nativeRuntime: msTeamsLazyApprovalNativeRuntime
|
|
369
|
+
}),
|
|
370
|
+
authorizeActorAction: (params) => require_thread_session.msTeamsApprovalAuth.authorizeActorAction?.(params)
|
|
371
|
+
};
|
|
279
372
|
//#endregion
|
|
280
373
|
//#region extensions/msteams/src/doctor.ts
|
|
281
374
|
const isMSTeamsMutableAllowEntry = (0, openclaw_plugin_sdk_channel_policy.buildMutableAllowEntryDetector)({
|
|
@@ -602,18 +695,6 @@ async function assertMSTeamsTeamEnumerationAllowed(params) {
|
|
|
602
695
|
return stableTeamId;
|
|
603
696
|
}
|
|
604
697
|
//#endregion
|
|
605
|
-
//#region extensions/msteams/src/monitor-handler/thread-session.ts
|
|
606
|
-
const TRAILING_THREAD_SUFFIX = /(?::thread:[^:]+)+$/;
|
|
607
|
-
function resolveMSTeamsRouteSessionKey(params) {
|
|
608
|
-
const channelThreadId = params.isChannel ? params.conversationMessageId ?? params.replyToId ?? void 0 : void 0;
|
|
609
|
-
const cleanBase = params.baseSessionKey.replace(TRAILING_THREAD_SUFFIX, "");
|
|
610
|
-
return (0, openclaw_plugin_sdk_routing.resolveThreadSessionKeys)({
|
|
611
|
-
baseSessionKey: cleanBase,
|
|
612
|
-
threadId: channelThreadId,
|
|
613
|
-
parentSessionKey: channelThreadId ? cleanBase : void 0
|
|
614
|
-
}).sessionKey;
|
|
615
|
-
}
|
|
616
|
-
//#endregion
|
|
617
698
|
//#region extensions/msteams/src/session-route.ts
|
|
618
699
|
function inferMSTeamsTargetChatType(raw) {
|
|
619
700
|
const target = (0, openclaw_plugin_sdk_channel_core.stripChannelTargetPrefix)(raw, "msteams", "teams");
|
|
@@ -657,7 +738,7 @@ function resolveMSTeamsOutboundSessionRoute(params) {
|
|
|
657
738
|
});
|
|
658
739
|
return isChannel ? {
|
|
659
740
|
...route,
|
|
660
|
-
sessionKey: resolveMSTeamsRouteSessionKey({
|
|
741
|
+
sessionKey: require_thread_session.resolveMSTeamsRouteSessionKey({
|
|
661
742
|
baseSessionKey: route.baseSessionKey,
|
|
662
743
|
isChannel: true,
|
|
663
744
|
conversationMessageId: channelThreadId
|
|
@@ -686,7 +767,13 @@ const collectMSTeamsSecurityWarnings = (0, openclaw_plugin_sdk_channel_policy.cr
|
|
|
686
767
|
resolveGroupPolicy: ({ cfg }) => cfg.channels?.msteams?.groupPolicy,
|
|
687
768
|
collect: ({ groupPolicy }) => groupPolicy === "open" ? ["- MS Teams groups: groupPolicy=\"open\" allows any member to trigger (mention-gated). Set channels.msteams.groupPolicy=\"allowlist\" + channels.msteams.groupAllowFrom to restrict senders."] : []
|
|
688
769
|
});
|
|
689
|
-
const
|
|
770
|
+
const collectMSTeamsSecurityFindings = openclaw_plugin_sdk_channel_policy.createConditionalWarningCollector.findings({
|
|
771
|
+
collectWarnings: collectMSTeamsSecurityWarnings,
|
|
772
|
+
checkId: "channels.msteams.groups.open",
|
|
773
|
+
severity: "critical",
|
|
774
|
+
title: "MS Teams security warning"
|
|
775
|
+
});
|
|
776
|
+
const loadMSTeamsChannelRuntime = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeNamedExport)(() => Promise.resolve().then(() => require("./channel.runtime-DuQWuKFd.cjs")), "msTeamsChannelRuntime");
|
|
690
777
|
function jsonActionResult(data) {
|
|
691
778
|
return {
|
|
692
779
|
content: [{
|
|
@@ -821,7 +908,8 @@ async function runWithRequiredActionPinnedMessageTarget(params) {
|
|
|
821
908
|
});
|
|
822
909
|
}
|
|
823
910
|
function describeMSTeamsMessageTool({ cfg }) {
|
|
824
|
-
const
|
|
911
|
+
const account = require_channel_setup.resolveMSTeamsAccount(cfg);
|
|
912
|
+
const enabled = account.enabled && account.configured && account.tokenStatus === "available";
|
|
825
913
|
return {
|
|
826
914
|
actions: enabled ? [
|
|
827
915
|
"upload-file",
|
|
@@ -856,6 +944,12 @@ const msteamsChannelOutbound = {
|
|
|
856
944
|
textChunkLimit: 4e3,
|
|
857
945
|
resolveEffectiveTextChunkLimit: ({ fallbackLimit }) => typeof fallbackLimit === "number" && fallbackLimit > 0 ? Math.min(fallbackLimit, 4e3) : 4e3,
|
|
858
946
|
pollMaxOptions: 12,
|
|
947
|
+
shouldSuppressLocalPayloadPrompt: ({ cfg, accountId, payload, hint }) => shouldSuppressLocalMSTeamsExecApprovalPrompt({
|
|
948
|
+
cfg,
|
|
949
|
+
accountId,
|
|
950
|
+
payload,
|
|
951
|
+
hint
|
|
952
|
+
}),
|
|
859
953
|
deliveryCapabilities: { durableFinal: {
|
|
860
954
|
text: true,
|
|
861
955
|
media: true,
|
|
@@ -891,39 +985,14 @@ const msteamsMessageAdapter = (0, openclaw_plugin_sdk_channel_outbound.createCha
|
|
|
891
985
|
});
|
|
892
986
|
const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlugin)({
|
|
893
987
|
base: {
|
|
894
|
-
|
|
895
|
-
meta: {
|
|
896
|
-
...require_setup_surface.msteamsMeta,
|
|
897
|
-
aliases: [...require_setup_surface.msteamsMeta.aliases]
|
|
898
|
-
},
|
|
899
|
-
setupWizard: require_setup_surface.msteamsSetupWizard,
|
|
900
|
-
capabilities: {
|
|
901
|
-
chatTypes: [
|
|
902
|
-
"direct",
|
|
903
|
-
"channel",
|
|
904
|
-
"thread"
|
|
905
|
-
],
|
|
906
|
-
polls: true,
|
|
907
|
-
threads: true,
|
|
908
|
-
media: true
|
|
909
|
-
},
|
|
988
|
+
...require_channel_setup.msteamsSetupPlugin,
|
|
910
989
|
streaming: { blockStreamingCoalesceDefaults: {
|
|
911
990
|
minChars: 1500,
|
|
912
991
|
idleMs: 1e3
|
|
913
992
|
} },
|
|
914
993
|
agentPrompt: { messageToolHints: () => ["- Adaptive Cards supported. Use `action=send` with `card={type,version,body}` to send rich cards.", "- MSTeams targeting: omit `target` to reply to the current conversation (auto-inferred). Explicit targets: `user:ID` or `user:Display Name` (requires Graph API) for DMs, `conversation:19:...@thread.tacv2` for groups/channels. Prefer IDs over display names for speed."] },
|
|
915
994
|
groups: { resolveToolPolicy: resolveMSTeamsGroupToolPolicy },
|
|
916
|
-
|
|
917
|
-
configSchema: require_config_schema.MSTeamsChannelConfigSchema,
|
|
918
|
-
config: {
|
|
919
|
-
...require_setup_surface.msteamsConfigAdapter,
|
|
920
|
-
isConfigured: (_account, cfg) => Boolean(require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams)),
|
|
921
|
-
describeAccount: (account) => (0, openclaw_plugin_sdk_account_helpers.describeAccountSnapshot)({
|
|
922
|
-
account,
|
|
923
|
-
configured: account.configured
|
|
924
|
-
})
|
|
925
|
-
},
|
|
926
|
-
approvalCapability: msTeamsApprovalAuth,
|
|
995
|
+
approvalCapability: msTeamsApprovalCapability,
|
|
927
996
|
doctor: {
|
|
928
997
|
dmAllowFromMode: "topOnly",
|
|
929
998
|
groupModel: "hybrid",
|
|
@@ -931,7 +1000,6 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
931
1000
|
warnOnEmptyGroupSenderAllowlist: true,
|
|
932
1001
|
collectMutableAllowlistWarnings: collectMSTeamsMutableAllowlistWarnings
|
|
933
1002
|
},
|
|
934
|
-
setupContract: require_setup_surface.msteamsSetupContract,
|
|
935
1003
|
messaging: {
|
|
936
1004
|
targetPrefixes: ["msteams", "teams"],
|
|
937
1005
|
directTargetStyle: "user-prefixed",
|
|
@@ -945,34 +1013,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
945
1013
|
},
|
|
946
1014
|
message: msteamsMessageAdapter,
|
|
947
1015
|
directory: (0, openclaw_plugin_sdk_directory_runtime.createChannelDirectoryAdapter)({
|
|
948
|
-
|
|
949
|
-
const creds = require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams);
|
|
950
|
-
if (!creds) return null;
|
|
951
|
-
return {
|
|
952
|
-
kind: "user",
|
|
953
|
-
id: creds.appId,
|
|
954
|
-
name: creds.appId
|
|
955
|
-
};
|
|
956
|
-
},
|
|
957
|
-
listPeers: async ({ cfg, query, limit }) => (0, openclaw_plugin_sdk_directory_runtime.listDirectoryEntriesFromSources)({
|
|
958
|
-
kind: "user",
|
|
959
|
-
sources: [cfg.channels?.msteams?.allowFrom ?? [], Object.keys(cfg.channels?.msteams?.dms ?? {})],
|
|
960
|
-
query,
|
|
961
|
-
limit,
|
|
962
|
-
normalizeId: (raw) => {
|
|
963
|
-
const normalized = require_resolve_allowlist.normalizeMSTeamsMessagingTarget(raw) ?? raw;
|
|
964
|
-
const lowered = normalized.toLowerCase();
|
|
965
|
-
if (lowered.startsWith("user:") || lowered.startsWith("conversation:")) return normalized;
|
|
966
|
-
return `user:${normalized}`;
|
|
967
|
-
}
|
|
968
|
-
}),
|
|
969
|
-
listGroups: async ({ cfg, query, limit }) => (0, openclaw_plugin_sdk_directory_runtime.listDirectoryEntriesFromSources)({
|
|
970
|
-
kind: "group",
|
|
971
|
-
sources: [Object.values(cfg.channels?.msteams?.teams ?? {}).flatMap((team) => Object.keys(team.channels ?? {}))],
|
|
972
|
-
query,
|
|
973
|
-
limit,
|
|
974
|
-
normalizeId: (raw) => `conversation:${raw.replace(/^conversation:/i, "").trim()}`
|
|
975
|
-
}),
|
|
1016
|
+
...require_directory_contract_api.msteamsDirectoryContractPlugin.directory,
|
|
976
1017
|
...(0, openclaw_plugin_sdk_directory_runtime.createRuntimeDirectoryLiveAdapter)({
|
|
977
1018
|
getRuntime: loadMSTeamsChannelRuntime,
|
|
978
1019
|
listPeersLive: (runtime) => runtime.listMSTeamsDirectoryPeersLive,
|
|
@@ -1087,6 +1128,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1087
1128
|
return results;
|
|
1088
1129
|
} },
|
|
1089
1130
|
actions: {
|
|
1131
|
+
providerOwnedReadGates: true,
|
|
1090
1132
|
describeMessageTool: describeMSTeamsMessageTool,
|
|
1091
1133
|
extractToolSendResult: ({ result, send }) => extractMSTeamsToolSendResult(result, send),
|
|
1092
1134
|
requiresTrustedRequesterSender: ({ action, toolContext }) => (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(toolContext?.currentChannelProvider)?.toLowerCase() === "msteams" && MSTEAMS_GROUP_MANAGEMENT_ACTIONS.has(action),
|
|
@@ -1467,11 +1509,14 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1467
1509
|
accountId: account.accountId,
|
|
1468
1510
|
enabled: account.enabled,
|
|
1469
1511
|
configured: account.configured,
|
|
1470
|
-
extra: {
|
|
1512
|
+
extra: {
|
|
1513
|
+
port: runtime?.port ?? null,
|
|
1514
|
+
tokenStatus: account.tokenStatus
|
|
1515
|
+
}
|
|
1471
1516
|
})
|
|
1472
1517
|
}),
|
|
1473
1518
|
gateway: { startAccount: async (ctx) => {
|
|
1474
|
-
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-
|
|
1519
|
+
const { monitorMSTeamsProvider } = await Promise.resolve().then(() => require("./src-NMnaP_95.cjs"));
|
|
1475
1520
|
const port = ctx.cfg.channels?.msteams?.webhook?.port ?? 3978;
|
|
1476
1521
|
const statusSink = (0, openclaw_plugin_sdk_channel_outbound.createAccountStatusSink)({
|
|
1477
1522
|
accountId: ctx.accountId,
|
|
@@ -1479,6 +1524,17 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1479
1524
|
});
|
|
1480
1525
|
statusSink({ port });
|
|
1481
1526
|
ctx.log?.info(`starting provider (port ${port})`);
|
|
1527
|
+
if (isMSTeamsNativeApprovalClientEnabled({
|
|
1528
|
+
cfg: ctx.cfg,
|
|
1529
|
+
accountId: ctx.accountId
|
|
1530
|
+
})) (0, openclaw_plugin_sdk_channel_runtime_context.registerChannelRuntimeContext)({
|
|
1531
|
+
channelRuntime: ctx.channelRuntime,
|
|
1532
|
+
channelId: "msteams",
|
|
1533
|
+
accountId: ctx.accountId,
|
|
1534
|
+
capability: openclaw_plugin_sdk_approval_handler_adapter_runtime.CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY,
|
|
1535
|
+
context: {},
|
|
1536
|
+
abortSignal: ctx.abortSignal
|
|
1537
|
+
});
|
|
1482
1538
|
return monitorMSTeamsProvider({
|
|
1483
1539
|
cfg: ctx.cfg,
|
|
1484
1540
|
runtime: ctx.runtime,
|
|
@@ -1487,7 +1543,7 @@ const msteamsPlugin = (0, openclaw_plugin_sdk_channel_core.createChatChannelPlug
|
|
|
1487
1543
|
});
|
|
1488
1544
|
} }
|
|
1489
1545
|
},
|
|
1490
|
-
security: { collectWarnings: (
|
|
1546
|
+
security: { collectWarnings: ({ cfg }) => collectMSTeamsSecurityFindings({ cfg }) },
|
|
1491
1547
|
pairing: { text: {
|
|
1492
1548
|
idLabel: "msteamsUserId",
|
|
1493
1549
|
message: openclaw_plugin_sdk_channel_status.PAIRING_APPROVED_MESSAGE,
|
|
@@ -1539,6 +1595,18 @@ Object.defineProperty(exports, "buildMSTeamsPresentationCard", {
|
|
|
1539
1595
|
return buildMSTeamsPresentationCard;
|
|
1540
1596
|
}
|
|
1541
1597
|
});
|
|
1598
|
+
Object.defineProperty(exports, "inferMSTeamsTargetChatType", {
|
|
1599
|
+
enumerable: true,
|
|
1600
|
+
get: function() {
|
|
1601
|
+
return inferMSTeamsTargetChatType;
|
|
1602
|
+
}
|
|
1603
|
+
});
|
|
1604
|
+
Object.defineProperty(exports, "isMSTeamsNativeApprovalClientEnabled", {
|
|
1605
|
+
enumerable: true,
|
|
1606
|
+
get: function() {
|
|
1607
|
+
return isMSTeamsNativeApprovalClientEnabled;
|
|
1608
|
+
}
|
|
1609
|
+
});
|
|
1542
1610
|
Object.defineProperty(exports, "msteamsPlugin", {
|
|
1543
1611
|
enumerable: true,
|
|
1544
1612
|
get: function() {
|
|
@@ -1563,9 +1631,9 @@ Object.defineProperty(exports, "resolveMSTeamsRouteConfig", {
|
|
|
1563
1631
|
return resolveMSTeamsRouteConfig;
|
|
1564
1632
|
}
|
|
1565
1633
|
});
|
|
1566
|
-
Object.defineProperty(exports, "
|
|
1634
|
+
Object.defineProperty(exports, "shouldHandleMSTeamsNativeApprovalRequest", {
|
|
1567
1635
|
enumerable: true,
|
|
1568
1636
|
get: function() {
|
|
1569
|
-
return
|
|
1637
|
+
return shouldHandleMSTeamsNativeApprovalRequest;
|
|
1570
1638
|
}
|
|
1571
1639
|
});
|