@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.
Files changed (35) hide show
  1. package/dist/.setup/{adapter.runtime-JoPydWqP.cjs → adapter.runtime-B-6Q3nMI.cjs} +6 -4
  2. package/dist/.setup/{approval-handler.runtime-bUN9icMr.cjs → approval-handler.runtime-DccVf5AY.cjs} +16 -6
  3. package/dist/.setup/{bot-framework-service-url-CPp4d-Q6.cjs → bot-framework-service-url-B3FWn2SV.cjs} +13 -0
  4. package/dist/.setup/{channel-Cifn9fsv.cjs → channel-B7Gy3QUW.cjs} +261 -175
  5. package/dist/.setup/{channel.runtime-DWRAolil.cjs → channel.runtime-DzKeQAqd.cjs} +84 -49
  6. package/dist/.setup/channel.setup-B5ClEcNI.cjs +990 -0
  7. package/dist/.setup/config-schema-CkKdphSp.cjs +293 -0
  8. package/dist/.setup/{conversation-store-state-DprmOfl7.cjs → conversation-store-state-C3__T9mK.cjs} +79 -91
  9. package/dist/.setup/delegated-state-Bv5cWuec.cjs +110 -0
  10. package/dist/.setup/{monitor-C9x_CJhY.cjs → monitor-CzRI-Hsc.cjs} +283 -240
  11. package/dist/.setup/{oauth-CWJ85AMw.cjs → oauth-D9u8sPCD.cjs} +1 -1
  12. package/dist/.setup/{reaction-types-Ig9sQJuR.cjs → reaction-types-DSQWVA4Z.cjs} +15 -9
  13. package/dist/.setup/{resolve-allowlist-DdDBVCzl.cjs → resolve-allowlist-tYgAHx0t.cjs} +252 -38
  14. package/dist/.setup/{secret-contract-api-ChQdBeU1.cjs → secret-contract-api-YY3v6MP8.cjs} +1 -1
  15. package/dist/.setup/secret-contract-api-wAyY5UHv.cjs +85 -0
  16. package/dist/.setup/{send-rJpcVtRp.cjs → send-Bgm8RYUa.cjs} +45 -24
  17. package/dist/.setup/{setup-plugin-api-DfoVOqMJ.cjs → setup-plugin-api-BACfeF7_.cjs} +1 -1
  18. package/dist/.setup/{thread-session-B74FC1Id.cjs → thread-session-C7KTMwLU.cjs} +11 -4
  19. package/dist/.setup/token-config-bEpua_Q7.cjs +93 -0
  20. package/dist/api.cjs +2 -2
  21. package/dist/channel-config-api.cjs +1 -1
  22. package/dist/channel-plugin-api.cjs +1 -1
  23. package/dist/directory-contract-api.cjs +30 -22
  24. package/dist/doctor-contract-api.cjs +11 -10
  25. package/dist/qa-runner-api.cjs +1 -1
  26. package/dist/runtime-api.cjs +2 -2
  27. package/dist/secret-contract-api.cjs +1 -1
  28. package/dist/setup-entry.cjs +2 -2
  29. package/dist/setup-plugin-api.cjs +1 -1
  30. package/openclaw.plugin.json +715 -0
  31. package/package.json +57 -6
  32. package/dist/.setup/channel.setup-BjbHugkL.cjs +0 -632
  33. package/dist/.setup/config-schema-Dk0mRIam.cjs +0 -160
  34. package/dist/.setup/secret-contract-api-ipiUsANg.cjs +0 -28
  35. package/dist/.setup/token-config-CqIh8z7Q.cjs +0 -138
@@ -1,160 +0,0 @@
1
- const require_bot_framework_service_url = require("./bot-framework-service-url-CPp4d-Q6.cjs");
2
- let openclaw_plugin_sdk_channel_core = require("openclaw/plugin-sdk/channel-core");
3
- let openclaw_plugin_sdk_ssrf_policy = require("openclaw/plugin-sdk/ssrf-policy");
4
- let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
5
- let openclaw_plugin_sdk_channel_config_schema = require("openclaw/plugin-sdk/channel-config-schema");
6
- let zod = require("zod");
7
- //#region extensions/msteams/src/config-ui-hints.ts
8
- const msTeamsChannelConfigUiHints = {
9
- "": {
10
- label: "MS Teams",
11
- help: "Microsoft Teams channel provider configuration and provider-specific policy toggles. Use this section to isolate Teams behavior from other enterprise chat providers."
12
- },
13
- configWrites: {
14
- label: "MS Teams Config Writes",
15
- help: "Allow Microsoft Teams to write config in response to channel events/commands (default: true)."
16
- },
17
- cloud: {
18
- label: "MS Teams Cloud",
19
- help: "Teams SDK cloud environment for auth, token validation, and token services: \"Public\", \"USGov\", \"USGovDoD\", or \"China\" (default: Public)."
20
- },
21
- serviceUrl: {
22
- label: "MS Teams Service URL",
23
- help: "Bot Connector service URL for SDK proactive sends/edits/deletes. Set with cloud for USGov/DoD; set alone for GCC."
24
- },
25
- graphMediaFallback: {
26
- label: "MS Teams Graph Media Fallback",
27
- help: "Query Microsoft Graph for unresolved channel or group-chat HTML media. Adds one lookup per matching message when enabled (default: false)."
28
- },
29
- requireMentionInBotThreads: {
30
- label: "Require Mentions in Bot Threads",
31
- help: "Override mention requirements for channel threads rooted at this bot's tracked messages. Unset preserves existing behavior. Channel overrides win over team and global values. Ownership tracking lasts up to 24 hours."
32
- },
33
- "teams.*.requireMentionInBotThreads": {
34
- label: "Team Bot Thread Mentions",
35
- help: "Override mention requirements for this bot's channel threads in this team. Unset inherits the global value."
36
- },
37
- "teams.*.channels.*.requireMentionInBotThreads": {
38
- label: "Channel Bot Thread Mentions",
39
- help: "Override mention requirements for this bot's threads in this channel. Unset inherits the team or global value."
40
- },
41
- ...(0, openclaw_plugin_sdk_channel_core.createChannelConfigUiHints)({
42
- channelLabel: "MS Teams",
43
- streaming: { "": {
44
- label: "MS Teams Streaming",
45
- help: "Microsoft Teams preview/progress streaming mode: \"off\" | \"partial\" | \"block\" | \"progress\". Personal chats use Teams native streaminfo progress when available."
46
- } },
47
- progress: {
48
- labels: "openclaw",
49
- titleWording: true
50
- }
51
- })
52
- };
53
- //#endregion
54
- //#region extensions/msteams/src/config-schema.ts
55
- const SecretInputSchema = (0, openclaw_plugin_sdk_secret_input.buildSecretInputSchema)();
56
- const ToolPolicyBySenderSchema = zod.z.record(zod.z.string(), openclaw_plugin_sdk_channel_config_schema.ToolPolicySchema).optional();
57
- const MSTeamsChannelSchema = zod.z.object({
58
- requireMention: zod.z.boolean().optional(),
59
- requireMentionInBotThreads: zod.z.boolean().optional(),
60
- tools: openclaw_plugin_sdk_channel_config_schema.ToolPolicySchema,
61
- toolsBySender: ToolPolicyBySenderSchema,
62
- replyStyle: openclaw_plugin_sdk_channel_config_schema.MSTeamsReplyStyleSchema.optional()
63
- }).strict();
64
- const MSTeamsTeamSchema = MSTeamsChannelSchema.extend({ channels: zod.z.record(zod.z.string(), MSTeamsChannelSchema.optional()).optional() });
65
- function isAzureChinaBotFrameworkServiceUrl(value) {
66
- return (0, openclaw_plugin_sdk_ssrf_policy.isHttpsUrlAllowedByHostnameSuffixAllowlist)(value.trim(), ["botframework.azure.cn"]);
67
- }
68
- const { accountShape, rootPolicyShape } = (0, openclaw_plugin_sdk_channel_config_schema.buildChannelAccountSchemaParts)({
69
- omit: [
70
- "name",
71
- "mentionPatterns",
72
- "replyToMode"
73
- ],
74
- allowFrom: zod.z.array(zod.z.string()).optional(),
75
- groupAllowFrom: zod.z.array(zod.z.string()).optional(),
76
- streaming: openclaw_plugin_sdk_channel_config_schema.ChannelPreviewStreamingConfigSchema.optional()
77
- });
78
- const MSTeamsConfigSchema = zod.z.object({
79
- ...accountShape,
80
- ...rootPolicyShape,
81
- dangerouslyAllowNameMatching: openclaw_plugin_sdk_channel_config_schema.ChannelDangerouslyAllowNameMatchingSchema,
82
- appId: zod.z.string().optional(),
83
- appPassword: (0, openclaw_plugin_sdk_secret_input.registerSensitiveConfigSchema)(SecretInputSchema.optional()),
84
- tenantId: zod.z.string().optional(),
85
- cloud: zod.z.enum([
86
- "Public",
87
- "USGov",
88
- "USGovDoD",
89
- "China"
90
- ]).optional(),
91
- serviceUrl: zod.z.string().url().refine(require_bot_framework_service_url.isAllowedBotFrameworkServiceUrl, { message: "channels.msteams.serviceUrl must use a supported Microsoft Teams Bot Connector host" }).optional(),
92
- authType: zod.z.enum(["secret", "federated"]).optional(),
93
- certificatePath: zod.z.string().optional(),
94
- certificateThumbprint: zod.z.string().optional(),
95
- useManagedIdentity: zod.z.boolean().optional(),
96
- managedIdentityClientId: zod.z.string().optional(),
97
- webhook: zod.z.object({ path: zod.z.string().optional() }).strict().optional(),
98
- legacyWebhook: zod.z.union([zod.z.literal(false), zod.z.object({
99
- port: zod.z.number().int().min(1).max(65535),
100
- host: zod.z.string().optional()
101
- }).strict()]).optional(),
102
- typingIndicator: zod.z.boolean().optional(),
103
- mediaAllowHosts: zod.z.array(zod.z.string()).optional(),
104
- mediaAuthAllowHosts: zod.z.array(zod.z.string()).optional(),
105
- graphMediaFallback: zod.z.boolean().optional(),
106
- requireMention: zod.z.boolean().optional(),
107
- requireMentionInBotThreads: zod.z.boolean().optional(),
108
- replyStyle: openclaw_plugin_sdk_channel_config_schema.MSTeamsReplyStyleSchema.optional(),
109
- teams: zod.z.record(zod.z.string(), MSTeamsTeamSchema.optional()).optional(),
110
- /** SharePoint site ID for file uploads in group chats/channels (e.g., "contoso.sharepoint.com,guid1,guid2") */
111
- sharePointSiteId: zod.z.string().optional(),
112
- welcomeCard: zod.z.boolean().optional(),
113
- promptStarters: zod.z.array(zod.z.string()).optional(),
114
- groupWelcomeCard: zod.z.boolean().optional(),
115
- feedbackEnabled: zod.z.boolean().optional(),
116
- feedbackReflection: zod.z.boolean().optional(),
117
- feedbackReflectionCooldownMs: zod.z.number().int().min(0).optional(),
118
- delegatedAuth: zod.z.object({
119
- enabled: zod.z.boolean().optional(),
120
- scopes: zod.z.array(zod.z.string()).optional()
121
- }).strict().optional(),
122
- sso: zod.z.object({
123
- enabled: zod.z.boolean().optional(),
124
- connectionName: zod.z.string().optional()
125
- }).strict().optional()
126
- }).strict().superRefine((value, ctx) => {
127
- (0, openclaw_plugin_sdk_channel_config_schema.refineChannelDmPolicy)({
128
- channelId: "msteams",
129
- value,
130
- ctx
131
- });
132
- if (value.sso?.enabled === true && !value.sso.connectionName?.trim()) ctx.addIssue({
133
- code: zod.z.ZodIssueCode.custom,
134
- path: ["sso", "connectionName"],
135
- message: "channels.msteams.sso.enabled=true requires channels.msteams.sso.connectionName to identify the Bot Framework OAuth connection"
136
- });
137
- if (value.cloud && value.cloud !== "Public" && value.cloud !== "China" && !value.serviceUrl?.trim()) ctx.addIssue({
138
- code: zod.z.ZodIssueCode.custom,
139
- path: ["serviceUrl"],
140
- message: "channels.msteams.cloud requires channels.msteams.serviceUrl for non-public Teams clouds"
141
- });
142
- if (value.cloud === "China" && value.serviceUrl?.trim() && !isAzureChinaBotFrameworkServiceUrl(value.serviceUrl)) ctx.addIssue({
143
- code: zod.z.ZodIssueCode.custom,
144
- path: ["serviceUrl"],
145
- message: "channels.msteams.cloud=China requires channels.msteams.serviceUrl to use an Azure China Bot Framework channel host"
146
- });
147
- if (value.cloud !== "China" && value.serviceUrl?.trim() && isAzureChinaBotFrameworkServiceUrl(value.serviceUrl)) ctx.addIssue({
148
- code: zod.z.ZodIssueCode.custom,
149
- path: ["cloud"],
150
- message: "Azure China Bot Framework serviceUrl hosts require channels.msteams.cloud=China"
151
- });
152
- });
153
- const MSTeamsChannelConfigSchema = (0, openclaw_plugin_sdk_channel_config_schema.buildChannelConfigSchema)(MSTeamsConfigSchema, { uiHints: msTeamsChannelConfigUiHints });
154
- //#endregion
155
- Object.defineProperty(exports, "MSTeamsChannelConfigSchema", {
156
- enumerable: true,
157
- get: function() {
158
- return MSTeamsChannelConfigSchema;
159
- }
160
- });
@@ -1,28 +0,0 @@
1
- //#region extensions/msteams/src/secret-contract.ts
2
- const channelSecrets = (0, require("openclaw/plugin-sdk/channel-secret-basic-runtime").createSimpleChannelSecretContract)({
3
- channelKey: "msteams",
4
- label: "Microsoft Teams",
5
- accountFields: [],
6
- channelFields: ["appPassword"],
7
- mode: "channel-only"
8
- });
9
- const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
10
- //#endregion
11
- Object.defineProperty(exports, "channelSecrets", {
12
- enumerable: true,
13
- get: function() {
14
- return channelSecrets;
15
- }
16
- });
17
- Object.defineProperty(exports, "collectRuntimeConfigAssignments", {
18
- enumerable: true,
19
- get: function() {
20
- return collectRuntimeConfigAssignments;
21
- }
22
- });
23
- Object.defineProperty(exports, "secretTargetRegistryEntries", {
24
- enumerable: true,
25
- get: function() {
26
- return secretTargetRegistryEntries;
27
- }
28
- });
@@ -1,138 +0,0 @@
1
- const require_runtime = require("./runtime-gZTAuFux.cjs");
2
- let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
3
- let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
4
- //#region extensions/msteams/src/delegated-state.ts
5
- const MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME = "msteams-delegated.json";
6
- const MSTEAMS_DELEGATED_TOKEN_NAMESPACE = "delegated-token";
7
- const MSTEAMS_DELEGATED_TOKEN_KEY = "current";
8
- function openDelegatedTokenStore() {
9
- return require_runtime.getMSTeamsRuntime().state.openKeyedStore({
10
- namespace: MSTEAMS_DELEGATED_TOKEN_NAMESPACE,
11
- maxEntries: 1,
12
- overflowPolicy: "reject-new"
13
- });
14
- }
15
- function normalizeMSTeamsDelegatedTokens(value) {
16
- if (!value || typeof value !== "object") return null;
17
- const token = value;
18
- if (typeof token.accessToken !== "string" || !token.accessToken || typeof token.refreshToken !== "string" || !token.refreshToken || typeof token.expiresAt !== "number" || !Number.isFinite(token.expiresAt) || !Array.isArray(token.scopes) || !token.scopes.every((scope) => typeof scope === "string" && scope.length > 0)) return null;
19
- return {
20
- accessToken: token.accessToken,
21
- refreshToken: token.refreshToken,
22
- expiresAt: token.expiresAt,
23
- scopes: [...token.scopes],
24
- ...typeof token.userPrincipalName === "string" ? { userPrincipalName: token.userPrincipalName } : {}
25
- };
26
- }
27
- async function loadMSTeamsDelegatedTokens() {
28
- return normalizeMSTeamsDelegatedTokens(await openDelegatedTokenStore().lookup("current")) ?? void 0;
29
- }
30
- async function saveMSTeamsDelegatedTokens(tokens) {
31
- const normalized = normalizeMSTeamsDelegatedTokens(tokens);
32
- if (!normalized) throw new Error("Invalid Microsoft Teams delegated token payload");
33
- await openDelegatedTokenStore().register(MSTEAMS_DELEGATED_TOKEN_KEY, normalized);
34
- }
35
- //#endregion
36
- //#region extensions/msteams/src/token-config.ts
37
- function resolveAuthType(cfg) {
38
- const fromCfg = cfg?.authType;
39
- if (fromCfg === "secret" || fromCfg === "federated") return fromCfg;
40
- if (process.env.MSTEAMS_AUTH_TYPE === "federated") return "federated";
41
- return "secret";
42
- }
43
- function resolveFederatedPath(configValue, envValue) {
44
- return (0, openclaw_plugin_sdk_string_coerce_runtime.readNonBlankString)(configValue) ?? (0, openclaw_plugin_sdk_string_coerce_runtime.readNonBlankString)(envValue);
45
- }
46
- function hasConfiguredMSTeamsCredentials(cfg) {
47
- const authType = resolveAuthType(cfg);
48
- const hasAppId = Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID));
49
- const hasTenantId = Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID));
50
- if (authType === "federated") {
51
- const hasCert = Boolean(resolveFederatedPath(cfg?.certificatePath, process.env.MSTEAMS_CERTIFICATE_PATH));
52
- const hasManagedIdentity = cfg?.useManagedIdentity ?? process.env.MSTEAMS_USE_MANAGED_IDENTITY === "true";
53
- return hasAppId && hasTenantId && (hasCert || hasManagedIdentity);
54
- }
55
- return Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) && (0, openclaw_plugin_sdk_secret_input.hasConfiguredSecretInput)(cfg?.appPassword) && (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId));
56
- }
57
- function resolveMSTeamsCredentials(cfg) {
58
- const authType = resolveAuthType(cfg);
59
- const appId = (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID);
60
- const tenantId = (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID);
61
- if (!appId || !tenantId) return;
62
- if (authType === "federated") {
63
- const certificatePath = resolveFederatedPath(cfg?.certificatePath, process.env.MSTEAMS_CERTIFICATE_PATH);
64
- const certificateThumbprint = cfg?.certificateThumbprint || process.env.MSTEAMS_CERTIFICATE_THUMBPRINT || void 0;
65
- const useManagedIdentity = cfg?.useManagedIdentity ?? process.env.MSTEAMS_USE_MANAGED_IDENTITY === "true";
66
- const managedIdentityClientId = cfg?.managedIdentityClientId || process.env.MSTEAMS_MANAGED_IDENTITY_CLIENT_ID || void 0;
67
- if (!certificatePath && !useManagedIdentity) return;
68
- return {
69
- type: "federated",
70
- appId,
71
- tenantId,
72
- certificatePath,
73
- certificateThumbprint,
74
- useManagedIdentity: useManagedIdentity || void 0,
75
- managedIdentityClientId
76
- };
77
- }
78
- const appPassword = (0, openclaw_plugin_sdk_secret_input.normalizeResolvedSecretInputString)({
79
- value: cfg?.appPassword,
80
- path: "channels.msteams.appPassword"
81
- }) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_PASSWORD);
82
- if (!appPassword) return;
83
- return {
84
- type: "secret",
85
- appId,
86
- appPassword,
87
- tenantId
88
- };
89
- }
90
- //#endregion
91
- Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_KEY", {
92
- enumerable: true,
93
- get: function() {
94
- return MSTEAMS_DELEGATED_TOKEN_KEY;
95
- }
96
- });
97
- Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME", {
98
- enumerable: true,
99
- get: function() {
100
- return MSTEAMS_DELEGATED_TOKEN_LEGACY_FILENAME;
101
- }
102
- });
103
- Object.defineProperty(exports, "MSTEAMS_DELEGATED_TOKEN_NAMESPACE", {
104
- enumerable: true,
105
- get: function() {
106
- return MSTEAMS_DELEGATED_TOKEN_NAMESPACE;
107
- }
108
- });
109
- Object.defineProperty(exports, "hasConfiguredMSTeamsCredentials", {
110
- enumerable: true,
111
- get: function() {
112
- return hasConfiguredMSTeamsCredentials;
113
- }
114
- });
115
- Object.defineProperty(exports, "loadMSTeamsDelegatedTokens", {
116
- enumerable: true,
117
- get: function() {
118
- return loadMSTeamsDelegatedTokens;
119
- }
120
- });
121
- Object.defineProperty(exports, "normalizeMSTeamsDelegatedTokens", {
122
- enumerable: true,
123
- get: function() {
124
- return normalizeMSTeamsDelegatedTokens;
125
- }
126
- });
127
- Object.defineProperty(exports, "resolveMSTeamsCredentials", {
128
- enumerable: true,
129
- get: function() {
130
- return resolveMSTeamsCredentials;
131
- }
132
- });
133
- Object.defineProperty(exports, "saveMSTeamsDelegatedTokens", {
134
- enumerable: true,
135
- get: function() {
136
- return saveMSTeamsDelegatedTokens;
137
- }
138
- });