@openclaw/msteams 2026.10.5-beta.4 → 2026.10.10-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-JoPydWqP.cjs → adapter.runtime-B-6Q3nMI.cjs} +6 -4
- package/dist/.setup/{approval-handler.runtime-bUN9icMr.cjs → approval-handler.runtime-DccVf5AY.cjs} +16 -6
- package/dist/.setup/{bot-framework-service-url-CPp4d-Q6.cjs → bot-framework-service-url-B3FWn2SV.cjs} +13 -0
- package/dist/.setup/{channel-Cifn9fsv.cjs → channel-B7Gy3QUW.cjs} +261 -175
- package/dist/.setup/{channel.runtime-DWRAolil.cjs → channel.runtime-DzKeQAqd.cjs} +84 -49
- package/dist/.setup/channel.setup-B5ClEcNI.cjs +990 -0
- package/dist/.setup/config-schema-CkKdphSp.cjs +293 -0
- package/dist/.setup/{conversation-store-state-DprmOfl7.cjs → conversation-store-state-C3__T9mK.cjs} +79 -91
- package/dist/.setup/delegated-state-Bv5cWuec.cjs +110 -0
- package/dist/.setup/{monitor-C9x_CJhY.cjs → monitor-CzRI-Hsc.cjs} +283 -240
- package/dist/.setup/{oauth-CWJ85AMw.cjs → oauth-D9u8sPCD.cjs} +1 -1
- package/dist/.setup/{reaction-types-Ig9sQJuR.cjs → reaction-types-DSQWVA4Z.cjs} +15 -9
- package/dist/.setup/{resolve-allowlist-DdDBVCzl.cjs → resolve-allowlist-tYgAHx0t.cjs} +252 -38
- package/dist/.setup/{secret-contract-api-ChQdBeU1.cjs → secret-contract-api-YY3v6MP8.cjs} +1 -1
- package/dist/.setup/secret-contract-api-wAyY5UHv.cjs +85 -0
- package/dist/.setup/{send-rJpcVtRp.cjs → send-Bgm8RYUa.cjs} +45 -24
- package/dist/.setup/{setup-plugin-api-DfoVOqMJ.cjs → setup-plugin-api-BACfeF7_.cjs} +1 -1
- package/dist/.setup/{thread-session-B74FC1Id.cjs → thread-session-C7KTMwLU.cjs} +11 -4
- package/dist/.setup/token-config-bEpua_Q7.cjs +93 -0
- package/dist/api.cjs +2 -2
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/directory-contract-api.cjs +30 -22
- package/dist/doctor-contract-api.cjs +11 -10
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/runtime-api.cjs +2 -2
- package/dist/secret-contract-api.cjs +1 -1
- package/dist/setup-entry.cjs +2 -2
- package/dist/setup-plugin-api.cjs +1 -1
- package/openclaw.plugin.json +715 -0
- package/package.json +57 -6
- package/dist/.setup/channel.setup-BjbHugkL.cjs +0 -632
- package/dist/.setup/config-schema-Dk0mRIam.cjs +0 -160
- package/dist/.setup/secret-contract-api-ipiUsANg.cjs +0 -28
- package/dist/.setup/token-config-CqIh8z7Q.cjs +0 -138
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
const require_bot_framework_service_url = require("./bot-framework-service-url-B3FWn2SV.cjs");
|
|
2
|
+
const require_token_config = require("./token-config-bEpua_Q7.cjs");
|
|
3
|
+
const require_resolve_allowlist = require("./resolve-allowlist-tYgAHx0t.cjs");
|
|
1
4
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
2
5
|
require("../runtime-api.cjs");
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const require_channel = require("./channel-Cifn9fsv.cjs");
|
|
7
|
-
const require_channel_setup = require("./channel.setup-BjbHugkL.cjs");
|
|
8
|
-
const require_conversation_store_state = require("./conversation-store-state-DprmOfl7.cjs");
|
|
6
|
+
const require_channel = require("./channel-B7Gy3QUW.cjs");
|
|
7
|
+
const require_channel_setup = require("./channel.setup-B5ClEcNI.cjs");
|
|
8
|
+
const require_conversation_store_state = require("./conversation-store-state-C3__T9mK.cjs");
|
|
9
9
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
10
10
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
11
|
+
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
11
12
|
let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
|
|
12
13
|
let openclaw_plugin_sdk_channel_inbound = require("openclaw/plugin-sdk/channel-inbound");
|
|
13
14
|
let openclaw_plugin_sdk_markdown_table_runtime = require("openclaw/plugin-sdk/markdown-table-runtime");
|
|
@@ -83,14 +84,21 @@ async function findConversationReference(recipient) {
|
|
|
83
84
|
} : null;
|
|
84
85
|
}
|
|
85
86
|
async function resolveMSTeamsSendContext(params) {
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
const accountId = (0, openclaw_plugin_sdk_account_id.normalizeAccountId)(params.accountId ?? require_resolve_allowlist.resolveDefaultMSTeamsAccountId(params.cfg));
|
|
88
|
+
const account = require_resolve_allowlist.resolveMSTeamsAccount({
|
|
89
|
+
cfg: params.cfg,
|
|
90
|
+
accountId
|
|
91
|
+
});
|
|
92
|
+
const msteamsCfg = account.config;
|
|
93
|
+
if (!account.enabled) throw new Error("msteams provider is not enabled");
|
|
89
94
|
if (account.tokenStatus === "configured_unavailable") throw new Error("msteams credential file is configured but unavailable");
|
|
90
95
|
if (!account.configured) throw new Error("msteams credentials not configured");
|
|
91
|
-
const creds = require_token_config.resolveMSTeamsCredentials(msteamsCfg
|
|
96
|
+
const creds = require_token_config.resolveMSTeamsCredentials(msteamsCfg, {
|
|
97
|
+
allowEnvFallback: accountId === openclaw_plugin_sdk_account_id.DEFAULT_ACCOUNT_ID,
|
|
98
|
+
pathPrefix: require_resolve_allowlist.resolveMSTeamsAccountConfigPath(params.cfg, accountId)
|
|
99
|
+
});
|
|
92
100
|
if (!creds) throw new Error("msteams credentials not configured");
|
|
93
|
-
const store = require_conversation_store_state.createMSTeamsConversationStoreState();
|
|
101
|
+
const store = require_conversation_store_state.createMSTeamsConversationStoreState({ accountId });
|
|
94
102
|
const recipient = parseRecipient(params.to);
|
|
95
103
|
const found = await findConversationReference({
|
|
96
104
|
...recipient,
|
|
@@ -144,9 +152,10 @@ async function resolveMSTeamsSendContext(params) {
|
|
|
144
152
|
});
|
|
145
153
|
const mediaMaxBytes = (0, openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes)({
|
|
146
154
|
cfg: params.cfg,
|
|
147
|
-
resolveChannelLimitMb: (
|
|
155
|
+
resolveChannelLimitMb: () => msteamsCfg.mediaMaxMb
|
|
148
156
|
});
|
|
149
157
|
return {
|
|
158
|
+
accountId,
|
|
150
159
|
conversationId,
|
|
151
160
|
ref: safeRef,
|
|
152
161
|
app,
|
|
@@ -208,17 +217,27 @@ function createMSTeamsSendResult(params) {
|
|
|
208
217
|
...params.pendingUploadId ? { pendingUploadId: params.pendingUploadId } : {}
|
|
209
218
|
};
|
|
210
219
|
}
|
|
220
|
+
function resolveMSTeamsMarkdownTableMode(cfg, accountId) {
|
|
221
|
+
return (0, openclaw_plugin_sdk_markdown_table_runtime.resolveMarkdownTableMode)({
|
|
222
|
+
cfg: {
|
|
223
|
+
...cfg,
|
|
224
|
+
channels: {
|
|
225
|
+
...cfg.channels,
|
|
226
|
+
msteams: require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId)
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
channel: "msteams"
|
|
230
|
+
});
|
|
231
|
+
}
|
|
211
232
|
/** Proactive delivery requires a conversation reference captured from an earlier inbound turn. */
|
|
212
233
|
async function sendMessageMSTeams(params) {
|
|
213
234
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
214
|
-
const { cfg, to, text, mediaUrl, filename, mediaAccess, mediaLocalRoots, mediaReadFile } = params;
|
|
215
|
-
const tableMode = (
|
|
216
|
-
cfg,
|
|
217
|
-
channel: "msteams"
|
|
218
|
-
});
|
|
235
|
+
const { cfg, accountId, to, text, mediaUrl, filename, mediaAccess, mediaLocalRoots, mediaReadFile } = params;
|
|
236
|
+
const tableMode = resolveMSTeamsMarkdownTableMode(cfg, accountId);
|
|
219
237
|
const messageText = require_conversation_store_state.formatMSTeamsMarkdown(text ?? "", tableMode);
|
|
220
238
|
const ctx = await resolveMSTeamsSendContext({
|
|
221
239
|
cfg,
|
|
240
|
+
accountId,
|
|
222
241
|
to
|
|
223
242
|
});
|
|
224
243
|
const { conversationId, log, conversationType, tokenProvider, sharePointSiteId } = ctx;
|
|
@@ -370,6 +389,7 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
|
|
|
370
389
|
const acceptedKinds = [];
|
|
371
390
|
try {
|
|
372
391
|
platformMessageIds = await require_conversation_store_state.sendMSTeamsMessages({
|
|
392
|
+
accountId: ctx.accountId,
|
|
373
393
|
assertDirectAdapterHandoff: options.assertDirectAdapterHandoff,
|
|
374
394
|
onPlatformSendDispatch: options.onPlatformSendDispatch,
|
|
375
395
|
onMessageSent: async (messageId, messageIndex) => {
|
|
@@ -426,6 +446,7 @@ async function sendTextWithMedia(ctx, text, mediaUrl, options) {
|
|
|
426
446
|
async function sendProactiveActivityRaw({ ctx, activity, assertDirectAdapterHandoff, onPlatformSendDispatch }) {
|
|
427
447
|
const baseRef = require_conversation_store_state.buildConversationReference(ctx.ref);
|
|
428
448
|
const response = await require_conversation_store_state.sendMSTeamsActivityWithReference(ctx.app, baseRef, activity, {
|
|
449
|
+
accountId: ctx.accountId,
|
|
429
450
|
assertDirectAdapterHandoff,
|
|
430
451
|
onPlatformSendDispatch,
|
|
431
452
|
...ctx.threadActivityId ? { threadActivityId: ctx.threadActivityId } : {},
|
|
@@ -442,9 +463,10 @@ async function sendProactiveActivity(params) {
|
|
|
442
463
|
}
|
|
443
464
|
async function sendPollMSTeams(params) {
|
|
444
465
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
445
|
-
const { cfg, to, question, options, maxSelections } = params;
|
|
466
|
+
const { cfg, accountId, to, question, options, maxSelections } = params;
|
|
446
467
|
const ctx = await resolveMSTeamsSendContext({
|
|
447
468
|
cfg,
|
|
469
|
+
accountId,
|
|
448
470
|
to
|
|
449
471
|
});
|
|
450
472
|
const { conversationId, log } = ctx;
|
|
@@ -478,9 +500,10 @@ async function sendPollMSTeams(params) {
|
|
|
478
500
|
}
|
|
479
501
|
async function sendAdaptiveCardMSTeams(params) {
|
|
480
502
|
require_resolve_allowlist.assertMSTeamsSendHandoff(params);
|
|
481
|
-
const { cfg, to, card } = params;
|
|
503
|
+
const { cfg, accountId, to, card } = params;
|
|
482
504
|
const ctx = await resolveMSTeamsSendContext({
|
|
483
505
|
cfg,
|
|
506
|
+
accountId,
|
|
484
507
|
to
|
|
485
508
|
});
|
|
486
509
|
const { conversationId, log } = ctx;
|
|
@@ -513,10 +536,7 @@ async function editMessageMSTeams(params) {
|
|
|
513
536
|
return mutateMSTeamsMessageActivity({
|
|
514
537
|
...params,
|
|
515
538
|
activity: {
|
|
516
|
-
...require_conversation_store_state.buildMSTeamsMessageActivity(require_conversation_store_state.formatMSTeamsMarkdown(params.text, (
|
|
517
|
-
cfg: params.cfg,
|
|
518
|
-
channel: "msteams"
|
|
519
|
-
}))),
|
|
539
|
+
...require_conversation_store_state.buildMSTeamsMessageActivity(require_conversation_store_state.formatMSTeamsMarkdown(params.text, resolveMSTeamsMarkdownTableMode(params.cfg, params.accountId))),
|
|
520
540
|
id: params.activityId
|
|
521
541
|
}
|
|
522
542
|
});
|
|
@@ -534,9 +554,10 @@ async function deleteMessageMSTeams(params) {
|
|
|
534
554
|
return mutateMSTeamsMessageActivity(params);
|
|
535
555
|
}
|
|
536
556
|
async function mutateMSTeamsMessageActivity(params) {
|
|
537
|
-
const { cfg, to, activityId, activity } = params;
|
|
557
|
+
const { cfg, accountId, to, activityId, activity } = params;
|
|
538
558
|
const { app, conversationId, ref, log, sdkCloudOptions } = await resolveMSTeamsSendContext({
|
|
539
559
|
cfg,
|
|
560
|
+
accountId,
|
|
540
561
|
to
|
|
541
562
|
});
|
|
542
563
|
const operation = activity ? "edit" : "delete";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_resolve_allowlist = require("./resolve-allowlist-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-tYgAHx0t.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");
|
|
@@ -11,8 +11,8 @@ function normalizeMSTeamsApproverId(value) {
|
|
|
11
11
|
}
|
|
12
12
|
const msTeamsApproval = (0, openclaw_plugin_sdk_approval_auth_runtime.createChannelApprovalAuth)({
|
|
13
13
|
channelLabel: "Microsoft Teams",
|
|
14
|
-
resolveInputs: ({ cfg }) => {
|
|
15
|
-
const channel = cfg
|
|
14
|
+
resolveInputs: ({ cfg, accountId }) => {
|
|
15
|
+
const channel = require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId);
|
|
16
16
|
return {
|
|
17
17
|
allowFrom: channel?.allowFrom,
|
|
18
18
|
defaultTo: channel?.defaultTo
|
|
@@ -26,7 +26,14 @@ const msTeamsApproval = (0, openclaw_plugin_sdk_approval_auth_runtime.createChan
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
const getMSTeamsApprovalApprovers = msTeamsApproval.resolveApprovers;
|
|
29
|
-
const msTeamsApprovalAuth =
|
|
29
|
+
const msTeamsApprovalAuth = { authorizeActorAction(params) {
|
|
30
|
+
const channel = params.cfg.channels?.msteams;
|
|
31
|
+
if (!channel || channel.enabled === false || require_resolve_allowlist.resolveMSTeamsAccountConfig(params.cfg, params.accountId).enabled === false) return {
|
|
32
|
+
authorized: false,
|
|
33
|
+
reason: "Microsoft Teams approval account is disabled or unavailable."
|
|
34
|
+
};
|
|
35
|
+
return msTeamsApproval.approvalAuth.authorizeActorAction(params);
|
|
36
|
+
} };
|
|
30
37
|
//#endregion
|
|
31
38
|
//#region extensions/msteams/src/monitor-handler/thread-session.ts
|
|
32
39
|
const TRAILING_THREAD_SUFFIX = /(?::thread:[^:]+)+$/;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
2
|
+
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
3
|
+
//#region extensions/msteams/src/token-config.ts
|
|
4
|
+
function resolveAuthType(cfg, options) {
|
|
5
|
+
const fromCfg = cfg?.authType;
|
|
6
|
+
if (fromCfg === "secret" || fromCfg === "federated") return fromCfg;
|
|
7
|
+
if ((options?.allowEnvFallback === false ? void 0 : process.env.MSTEAMS_AUTH_TYPE) === "federated") return "federated";
|
|
8
|
+
return "secret";
|
|
9
|
+
}
|
|
10
|
+
function resolveFederatedPath(configValue, envValue) {
|
|
11
|
+
return (0, openclaw_plugin_sdk_string_coerce_runtime.readNonBlankString)(configValue) ?? (0, openclaw_plugin_sdk_string_coerce_runtime.readNonBlankString)(envValue);
|
|
12
|
+
}
|
|
13
|
+
function resolveMSTeamsAppId(cfg, allowEnvFallback) {
|
|
14
|
+
return (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) || (allowEnvFallback ? (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID) : void 0);
|
|
15
|
+
}
|
|
16
|
+
function resolveMSTeamsTenantId(cfg, allowEnvFallback) {
|
|
17
|
+
return (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId) || (allowEnvFallback ? (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID) : void 0);
|
|
18
|
+
}
|
|
19
|
+
function hasConfiguredMSTeamsCredentials(cfg, options) {
|
|
20
|
+
return inspectMSTeamsCredentials(cfg, options).status !== "missing";
|
|
21
|
+
}
|
|
22
|
+
function resolveMSTeamsCredentials(cfg, options) {
|
|
23
|
+
const allowEnvFallback = options?.allowEnvFallback ?? true;
|
|
24
|
+
const pathPrefix = options?.pathPrefix ?? "channels.msteams";
|
|
25
|
+
const authType = resolveAuthType(cfg, { allowEnvFallback });
|
|
26
|
+
const appId = resolveMSTeamsAppId(cfg, allowEnvFallback);
|
|
27
|
+
const tenantId = resolveMSTeamsTenantId(cfg, allowEnvFallback);
|
|
28
|
+
if (!appId || !tenantId) return;
|
|
29
|
+
if (authType === "federated") {
|
|
30
|
+
const certificatePath = resolveFederatedPath(cfg?.certificatePath, allowEnvFallback ? process.env.MSTEAMS_CERTIFICATE_PATH : void 0);
|
|
31
|
+
const certificateThumbprint = cfg?.certificateThumbprint || (allowEnvFallback ? process.env.MSTEAMS_CERTIFICATE_THUMBPRINT : void 0) || void 0;
|
|
32
|
+
const useManagedIdentity = cfg?.useManagedIdentity ?? (allowEnvFallback ? process.env.MSTEAMS_USE_MANAGED_IDENTITY === "true" : false);
|
|
33
|
+
const managedIdentityClientId = cfg?.managedIdentityClientId || (allowEnvFallback ? process.env.MSTEAMS_MANAGED_IDENTITY_CLIENT_ID : void 0) || void 0;
|
|
34
|
+
if (!certificatePath && !useManagedIdentity) return;
|
|
35
|
+
return {
|
|
36
|
+
type: "federated",
|
|
37
|
+
appId,
|
|
38
|
+
tenantId,
|
|
39
|
+
certificatePath,
|
|
40
|
+
certificateThumbprint,
|
|
41
|
+
useManagedIdentity: useManagedIdentity || void 0,
|
|
42
|
+
managedIdentityClientId
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const appPassword = (0, openclaw_plugin_sdk_secret_input.normalizeResolvedSecretInputString)({
|
|
46
|
+
value: cfg?.appPassword,
|
|
47
|
+
path: `${pathPrefix}.appPassword`
|
|
48
|
+
}) || (allowEnvFallback ? (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_PASSWORD) : void 0);
|
|
49
|
+
if (!appPassword) return;
|
|
50
|
+
return {
|
|
51
|
+
type: "secret",
|
|
52
|
+
appId,
|
|
53
|
+
appPassword,
|
|
54
|
+
tenantId
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/** Read credential availability for diagnostics without redeeming unresolved SecretRefs. */
|
|
58
|
+
function inspectMSTeamsCredentials(cfg, options) {
|
|
59
|
+
const allowEnvFallback = options?.allowEnvFallback ?? true;
|
|
60
|
+
const authType = resolveAuthType(cfg, { allowEnvFallback });
|
|
61
|
+
const appId = resolveMSTeamsAppId(cfg, allowEnvFallback);
|
|
62
|
+
const tenantId = resolveMSTeamsTenantId(cfg, allowEnvFallback);
|
|
63
|
+
if (!appId || !tenantId) return { status: "missing" };
|
|
64
|
+
if (authType === "federated") {
|
|
65
|
+
const credentials = resolveMSTeamsCredentials(cfg, { allowEnvFallback });
|
|
66
|
+
return credentials?.type === "federated" ? {
|
|
67
|
+
credentials,
|
|
68
|
+
status: "available"
|
|
69
|
+
} : { status: "missing" };
|
|
70
|
+
}
|
|
71
|
+
if ((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appPassword)) return { status: "available" };
|
|
72
|
+
if ((0, openclaw_plugin_sdk_secret_input.hasConfiguredSecretInput)(cfg?.appPassword)) return { status: "configured_unavailable" };
|
|
73
|
+
return (allowEnvFallback ? (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_PASSWORD) : void 0) ? { status: "available" } : { status: "missing" };
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
Object.defineProperty(exports, "hasConfiguredMSTeamsCredentials", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function() {
|
|
79
|
+
return hasConfiguredMSTeamsCredentials;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "inspectMSTeamsCredentials", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function() {
|
|
85
|
+
return inspectMSTeamsCredentials;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(exports, "resolveMSTeamsCredentials", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
get: function() {
|
|
91
|
+
return resolveMSTeamsCredentials;
|
|
92
|
+
}
|
|
93
|
+
});
|
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-B7Gy3QUW.cjs");
|
|
3
|
+
const require_channel_setup = require("./.setup/channel.setup-B5ClEcNI.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-CkKdphSp.cjs");
|
|
3
3
|
exports.MSTeamsChannelConfigSchema = require_config_schema.MSTeamsChannelConfigSchema;
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_resolve_allowlist = require("./.setup/resolve-allowlist-
|
|
3
|
-
const require_token_config = require("./.setup/token-config-CqIh8z7Q.cjs");
|
|
2
|
+
const require_resolve_allowlist = require("./.setup/resolve-allowlist-tYgAHx0t.cjs");
|
|
4
3
|
let openclaw_plugin_sdk_directory_runtime = require("openclaw/plugin-sdk/directory-runtime");
|
|
5
4
|
const msteamsDirectoryContractPlugin = {
|
|
6
5
|
id: "msteams",
|
|
7
6
|
directory: {
|
|
8
|
-
self: async ({ cfg }) => {
|
|
9
|
-
const creds =
|
|
7
|
+
self: async ({ cfg, accountId }) => {
|
|
8
|
+
const { credentials: creds } = require_resolve_allowlist.resolveMSTeamsRuntimeAccount({
|
|
9
|
+
cfg,
|
|
10
|
+
accountId
|
|
11
|
+
});
|
|
10
12
|
return creds ? {
|
|
11
13
|
kind: "user",
|
|
12
14
|
id: creds.appId,
|
|
13
15
|
name: creds.appId
|
|
14
16
|
} : null;
|
|
15
17
|
},
|
|
16
|
-
listPeers: async ({ cfg, query, limit }) =>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
listPeers: async ({ cfg, accountId, query, limit }) => {
|
|
19
|
+
const msteamsCfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId);
|
|
20
|
+
return (0, openclaw_plugin_sdk_directory_runtime.listDirectoryEntriesFromSources)({
|
|
21
|
+
kind: "user",
|
|
22
|
+
sources: [msteamsCfg.allowFrom ?? [], Object.keys(msteamsCfg.dms ?? {})],
|
|
23
|
+
query,
|
|
24
|
+
limit,
|
|
25
|
+
normalizeId: (raw) => {
|
|
26
|
+
const normalized = require_resolve_allowlist.normalizeMSTeamsMessagingTarget(raw) ?? raw;
|
|
27
|
+
const lowered = normalized.toLowerCase();
|
|
28
|
+
return lowered.startsWith("user:") || lowered.startsWith("conversation:") ? normalized : `user:${normalized}`;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
listGroups: async ({ cfg, accountId, query, limit }) => {
|
|
33
|
+
const msteamsCfg = require_resolve_allowlist.resolveMSTeamsAccountConfig(cfg, accountId);
|
|
34
|
+
return (0, openclaw_plugin_sdk_directory_runtime.listDirectoryEntriesFromSources)({
|
|
35
|
+
kind: "group",
|
|
36
|
+
sources: [Object.values(msteamsCfg.teams ?? {}).flatMap((team) => Object.keys(team.channels ?? {}))],
|
|
37
|
+
query,
|
|
38
|
+
limit,
|
|
39
|
+
normalizeId: (raw) => `conversation:${raw.replace(/^conversation:/i, "").trim()}`
|
|
40
|
+
});
|
|
41
|
+
}
|
|
34
42
|
}
|
|
35
43
|
};
|
|
36
44
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_rolldown_runtime = require("./.setup/rolldown-runtime-BloeesfJ.cjs");
|
|
3
|
-
const require_token_config = require("./.setup/token-config-
|
|
3
|
+
const require_token_config = require("./.setup/token-config-bEpua_Q7.cjs");
|
|
4
|
+
const require_delegated_state = require("./.setup/delegated-state-Bv5cWuec.cjs");
|
|
4
5
|
const require_doctor_backup_resources = require("./doctor-backup-resources.cjs");
|
|
5
6
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
6
7
|
let openclaw_plugin_sdk_error_runtime = require("openclaw/plugin-sdk/error-runtime");
|
|
@@ -264,11 +265,11 @@ const stateMigrations = [
|
|
|
264
265
|
{
|
|
265
266
|
id: "msteams-delegated-token-json-to-plugin-state",
|
|
266
267
|
label: "Microsoft Teams delegated OAuth token",
|
|
267
|
-
collectBackupResources: ({ stateDir }) => require_doctor_backup_resources.stateFileBackupResources(stateDir,
|
|
268
|
+
collectBackupResources: ({ stateDir }) => require_doctor_backup_resources.stateFileBackupResources(stateDir, require_delegated_state.MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME),
|
|
268
269
|
async detectLegacyState(params) {
|
|
269
|
-
const filePath = node_path.default.join(params.stateDir,
|
|
270
|
+
const filePath = node_path.default.join(params.stateDir, require_delegated_state.MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME);
|
|
270
271
|
try {
|
|
271
|
-
return (await node_fs_promises.default.stat(filePath)).isFile() ? { preview: [`- ${MSTEAMS_PLUGIN_ID} delegated OAuth token -> plugin state (${
|
|
272
|
+
return (await node_fs_promises.default.stat(filePath)).isFile() ? { preview: [`- ${MSTEAMS_PLUGIN_ID} delegated OAuth token -> plugin state (${require_delegated_state.MSTEAMS_DELEGATED_TOKEN_NAMESPACE})`] } : null;
|
|
272
273
|
} catch {
|
|
273
274
|
return null;
|
|
274
275
|
}
|
|
@@ -276,10 +277,10 @@ const stateMigrations = [
|
|
|
276
277
|
async migrateLegacyState(params) {
|
|
277
278
|
const changes = [];
|
|
278
279
|
const warnings = [];
|
|
279
|
-
const filePath = node_path.default.join(params.stateDir,
|
|
280
|
+
const filePath = node_path.default.join(params.stateDir, require_delegated_state.MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME);
|
|
280
281
|
let token;
|
|
281
282
|
try {
|
|
282
|
-
token =
|
|
283
|
+
token = require_delegated_state.normalizeMSTeamsDelegatedTokens(JSON.parse(await node_fs_promises.default.readFile(filePath, "utf8")));
|
|
283
284
|
} catch (error) {
|
|
284
285
|
if (error.code === "ENOENT") return {
|
|
285
286
|
changes,
|
|
@@ -299,11 +300,11 @@ const stateMigrations = [
|
|
|
299
300
|
};
|
|
300
301
|
}
|
|
301
302
|
const store = params.context.openPluginStateKeyedStore({
|
|
302
|
-
namespace:
|
|
303
|
+
namespace: require_delegated_state.MSTEAMS_DELEGATED_TOKEN_NAMESPACE,
|
|
303
304
|
maxEntries: 1,
|
|
304
305
|
overflowPolicy: "reject-new"
|
|
305
306
|
});
|
|
306
|
-
const existing = await store.lookup(
|
|
307
|
+
const existing = await store.lookup(require_delegated_state.MSTEAMS_DELEGATED_TOKEN_KEY);
|
|
307
308
|
if (existing && JSON.stringify(existing) !== JSON.stringify(token)) {
|
|
308
309
|
warnings.push(`Kept existing ${MSTEAMS_PLUGIN_ID} delegated OAuth token in plugin state; left differing legacy source in place`);
|
|
309
310
|
return {
|
|
@@ -312,7 +313,7 @@ const stateMigrations = [
|
|
|
312
313
|
};
|
|
313
314
|
}
|
|
314
315
|
if (!existing) try {
|
|
315
|
-
await store.registerIfAbsent(
|
|
316
|
+
await store.registerIfAbsent(require_delegated_state.MSTEAMS_DELEGATED_TOKEN_KEY, token);
|
|
316
317
|
} catch (error) {
|
|
317
318
|
warnings.push(`Failed importing ${MSTEAMS_PLUGIN_ID} delegated OAuth token: ${String(error)}; left legacy source in place`);
|
|
318
319
|
return {
|
|
@@ -320,7 +321,7 @@ const stateMigrations = [
|
|
|
320
321
|
warnings
|
|
321
322
|
};
|
|
322
323
|
}
|
|
323
|
-
const persisted =
|
|
324
|
+
const persisted = require_delegated_state.normalizeMSTeamsDelegatedTokens(await store.lookup(require_delegated_state.MSTEAMS_DELEGATED_TOKEN_KEY));
|
|
324
325
|
if (!persisted || JSON.stringify(persisted) !== JSON.stringify(token)) {
|
|
325
326
|
warnings.push(`Failed verifying ${MSTEAMS_PLUGIN_ID} delegated OAuth token in plugin state; left legacy source in place`);
|
|
326
327
|
return {
|
package/dist/qa-runner-api.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
let openclaw_plugin_sdk_qa_runner_runtime = require("openclaw/plugin-sdk/qa-runner-runtime");
|
|
3
3
|
//#region extensions/msteams/src/qa/cli.ts
|
|
4
4
|
const DEFAULT_MSTEAMS_QA_SCENARIOS = ["channel-canary"];
|
|
5
|
-
const loadMSTeamsQaAdapterRuntime = (0, openclaw_plugin_sdk_qa_runner_runtime.createLazyCliRuntimeLoader)(() => Promise.resolve().then(() => require("./.setup/adapter.runtime-
|
|
5
|
+
const loadMSTeamsQaAdapterRuntime = (0, openclaw_plugin_sdk_qa_runner_runtime.createLazyCliRuntimeLoader)(() => Promise.resolve().then(() => require("./.setup/adapter.runtime-B-6Q3nMI.cjs")));
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region extensions/msteams/qa-runner-api.ts
|
|
8
8
|
const qaRunnerCliRegistrations = [(0, openclaw_plugin_sdk_qa_runner_runtime.createLiveTransportQaCliRegistration)({
|
package/dist/runtime-api.cjs
CHANGED
|
@@ -2,14 +2,14 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_runtime = require("./.setup/runtime-gZTAuFux.cjs");
|
|
3
3
|
let openclaw_plugin_sdk_channel_outbound = require("openclaw/plugin-sdk/channel-outbound");
|
|
4
4
|
let openclaw_plugin_sdk_channel_pairing = require("openclaw/plugin-sdk/channel-pairing");
|
|
5
|
-
let
|
|
5
|
+
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
6
6
|
let openclaw_plugin_sdk_account_id = require("openclaw/plugin-sdk/account-id");
|
|
7
|
+
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
7
8
|
let openclaw_plugin_sdk_channel_status = require("openclaw/plugin-sdk/channel-status");
|
|
8
9
|
let openclaw_plugin_sdk_channel_targets = require("openclaw/plugin-sdk/channel-targets");
|
|
9
10
|
let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/dangerous-name-runtime");
|
|
10
11
|
let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
|
|
11
12
|
let openclaw_plugin_sdk_media_runtime = require("openclaw/plugin-sdk/media-runtime");
|
|
12
|
-
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
13
13
|
let openclaw_plugin_sdk_outbound_media = require("openclaw/plugin-sdk/outbound-media");
|
|
14
14
|
let openclaw_plugin_sdk_reply_payload = require("openclaw/plugin-sdk/reply-payload");
|
|
15
15
|
let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_secret_contract_api = require("./.setup/secret-contract-api-
|
|
2
|
+
const require_secret_contract_api = require("./.setup/secret-contract-api-wAyY5UHv.cjs");
|
|
3
3
|
exports.channelSecrets = require_secret_contract_api.channelSecrets;
|
|
4
4
|
exports.collectRuntimeConfigAssignments = require_secret_contract_api.collectRuntimeConfigAssignments;
|
|
5
5
|
exports.secretTargetRegistryEntries = require_secret_contract_api.secretTargetRegistryEntries;
|
package/dist/setup-entry.cjs
CHANGED
|
@@ -4,11 +4,11 @@ let node_url = require("node:url");
|
|
|
4
4
|
var setup_entry_default = (0, openclaw_plugin_sdk_channel_entry_contract.defineBundledChannelSetupEntry)({
|
|
5
5
|
importMetaUrl: require("url").pathToFileURL(__filename).href,
|
|
6
6
|
plugin: {
|
|
7
|
-
specifier: (0, node_url.fileURLToPath)(new URL(".setup/setup-plugin-api-
|
|
7
|
+
specifier: (0, node_url.fileURLToPath)(new URL(".setup/setup-plugin-api-BACfeF7_.cjs", require("url").pathToFileURL(__filename).href).href),
|
|
8
8
|
exportName: "msteamsSetupPlugin"
|
|
9
9
|
},
|
|
10
10
|
secrets: {
|
|
11
|
-
specifier: (0, node_url.fileURLToPath)(new URL(".setup/secret-contract-api-
|
|
11
|
+
specifier: (0, node_url.fileURLToPath)(new URL(".setup/secret-contract-api-YY3v6MP8.cjs", require("url").pathToFileURL(__filename).href).href),
|
|
12
12
|
exportName: "channelSecrets"
|
|
13
13
|
}
|
|
14
14
|
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_channel_setup = require("./.setup/channel.setup-
|
|
2
|
+
const require_channel_setup = require("./.setup/channel.setup-B5ClEcNI.cjs");
|
|
3
3
|
exports.msteamsSetupPlugin = require_channel_setup.msteamsSetupPlugin;
|