@openclaw/msteams 2026.6.1 → 2026.6.5-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/api.js +2 -2
- package/dist/{channel-Dhw8AvTl.js → channel--oT3fyD5.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-t52N99bX.js → channel.runtime-KNuY2Oaw.js} +5 -4
- package/dist/directory-contract-api.js +35 -0
- package/dist/doctor-contract-api.js +254 -44
- package/dist/{oauth-ei63gdyS.js → oauth-CDUB5xPY.js} +1 -1
- package/dist/polls-C1VgSvKE.js +548 -0
- package/dist/{probe-DYb-0Hmx.js → probe-C-rWMb-m.js} +10 -742
- package/dist/{errors-Dpn8B05h.js → resolve-allowlist-BzIUWmMm.js} +334 -165
- package/dist/runtime-BS5AZrKK.js +8 -0
- package/dist/runtime-api.js +19 -1
- package/dist/setup-plugin-api.js +2 -2
- package/dist/{setup-surface-DGTz8Mlf.js → setup-surface-Dik4VU7f.js} +180 -220
- package/dist/{src-DZ76sgTp.js → src-CLsoqMj1.js} +9 -124
- package/dist/sso-token-store-BYZaKr82.js +70 -0
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +3 -0
- package/package.json +4 -4
- package/dist/oauth.token-BKzEFepQ.js +0 -132
- package/dist/runtime-api-BlvMnDKz.js +0 -26
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/msteams",
|
|
3
|
-
"version": "2026.6.1",
|
|
3
|
+
"version": "2026.6.5-beta.1",
|
|
4
4
|
"description": "OpenClaw Microsoft Teams channel plugin for bot conversations.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"typebox": "1.1.39"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.6.1"
|
|
18
|
+
"openclaw": ">=2026.6.5-beta.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"minHostVersion": ">=2026.4.10"
|
|
52
52
|
},
|
|
53
53
|
"compat": {
|
|
54
|
-
"pluginApi": ">=2026.6.1"
|
|
54
|
+
"pluginApi": ">=2026.6.5-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"build": {
|
|
57
|
-
"openclawVersion": "2026.6.1"
|
|
57
|
+
"openclawVersion": "2026.6.5-beta.1"
|
|
58
58
|
},
|
|
59
59
|
"release": {
|
|
60
60
|
"publishToClawHub": true,
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
2
|
-
import { createProviderHttpError, readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
3
|
-
import { resolveExpiresAtMsFromDurationSeconds } from "openclaw/plugin-sdk/number-runtime";
|
|
4
|
-
//#region extensions/msteams/src/http-error.ts
|
|
5
|
-
async function createMSTeamsHttpError(response, label, options) {
|
|
6
|
-
return await createProviderHttpError(response, label, options);
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region extensions/msteams/src/oauth.shared.ts
|
|
10
|
-
const MSTEAMS_OAUTH_REDIRECT_URI = "http://localhost:8086/oauth2callback";
|
|
11
|
-
const MSTEAMS_OAUTH_CALLBACK_PORT = 8086;
|
|
12
|
-
const MSTEAMS_OAUTH_CALLBACK_PATH = "/oauth2callback";
|
|
13
|
-
const MSTEAMS_DEFAULT_TOKEN_FETCH_TIMEOUT_MS = 1e4;
|
|
14
|
-
const MSTEAMS_DEFAULT_DELEGATED_SCOPES = [
|
|
15
|
-
"ChatMessage.Send",
|
|
16
|
-
"ChannelMessage.Send",
|
|
17
|
-
"Chat.ReadWrite",
|
|
18
|
-
"offline_access"
|
|
19
|
-
];
|
|
20
|
-
function buildMSTeamsAuthEndpoint(tenantId) {
|
|
21
|
-
return `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/authorize`;
|
|
22
|
-
}
|
|
23
|
-
function buildMSTeamsTokenEndpoint(tenantId) {
|
|
24
|
-
return `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`;
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region extensions/msteams/src/oauth.token.ts
|
|
28
|
-
/** Five-minute buffer subtracted from token expiry to avoid edge-case clock drift. */
|
|
29
|
-
const EXPIRY_BUFFER_MS = 300 * 1e3;
|
|
30
|
-
function createMSTeamsTokenBody(params) {
|
|
31
|
-
const body = new URLSearchParams({
|
|
32
|
-
client_id: params.clientId,
|
|
33
|
-
client_secret: params.clientSecret,
|
|
34
|
-
grant_type: params.grantType,
|
|
35
|
-
scope: [...params.scopes].join(" ")
|
|
36
|
-
});
|
|
37
|
-
for (const [key, value] of Object.entries(params.values ?? {})) body.set(key, value);
|
|
38
|
-
return body;
|
|
39
|
-
}
|
|
40
|
-
function resolveMSTeamsTokenExpiresAt(value) {
|
|
41
|
-
return resolveExpiresAtMsFromDurationSeconds(value, { bufferMs: EXPIRY_BUFFER_MS });
|
|
42
|
-
}
|
|
43
|
-
function parseMSTeamsTokenResponse(data, failureLabel) {
|
|
44
|
-
const expiresAt = resolveMSTeamsTokenExpiresAt(data.expires_in);
|
|
45
|
-
if (typeof data.access_token !== "string" || !data.access_token || expiresAt === void 0 || data.refresh_token !== void 0 && typeof data.refresh_token !== "string" || data.scope !== void 0 && typeof data.scope !== "string") throw new Error(`MSTeams ${failureLabel} failed: invalid token response fields`);
|
|
46
|
-
return {
|
|
47
|
-
access_token: data.access_token,
|
|
48
|
-
refresh_token: data.refresh_token,
|
|
49
|
-
expiresAt,
|
|
50
|
-
scope: data.scope
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
async function fetchMSTeamsTokens(params) {
|
|
54
|
-
const currentFetch = globalThis.fetch;
|
|
55
|
-
const { response, release } = await fetchWithSsrFGuard({
|
|
56
|
-
url: params.tokenUrl,
|
|
57
|
-
fetchImpl: async (input, guardedInit) => await currentFetch(input, guardedInit),
|
|
58
|
-
init: {
|
|
59
|
-
method: "POST",
|
|
60
|
-
headers: {
|
|
61
|
-
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
|
|
62
|
-
Accept: "application/json"
|
|
63
|
-
},
|
|
64
|
-
body: params.body,
|
|
65
|
-
signal: AbortSignal.timeout(MSTEAMS_DEFAULT_TOKEN_FETCH_TIMEOUT_MS)
|
|
66
|
-
},
|
|
67
|
-
auditContext: params.auditContext
|
|
68
|
-
});
|
|
69
|
-
try {
|
|
70
|
-
if (!response.ok) throw await createMSTeamsHttpError(response, `MSTeams ${params.failureLabel} failed`);
|
|
71
|
-
return parseMSTeamsTokenResponse(await readProviderJsonResponse(response, `MSTeams ${params.failureLabel} failed`), params.failureLabel);
|
|
72
|
-
} finally {
|
|
73
|
-
await release();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async function requestMSTeamsDelegatedTokens(params) {
|
|
77
|
-
const scopes = params.scopes ?? MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
78
|
-
const body = createMSTeamsTokenBody({
|
|
79
|
-
clientId: params.clientId,
|
|
80
|
-
clientSecret: params.clientSecret,
|
|
81
|
-
grantType: params.grantType,
|
|
82
|
-
scopes,
|
|
83
|
-
values: params.values
|
|
84
|
-
});
|
|
85
|
-
const data = await fetchMSTeamsTokens({
|
|
86
|
-
tokenUrl: buildMSTeamsTokenEndpoint(params.tenantId),
|
|
87
|
-
body,
|
|
88
|
-
auditContext: params.auditContext,
|
|
89
|
-
failureLabel: params.failureLabel
|
|
90
|
-
});
|
|
91
|
-
return {
|
|
92
|
-
accessToken: data.access_token,
|
|
93
|
-
refreshToken: params.resolveRefreshToken(data),
|
|
94
|
-
expiresAt: data.expiresAt,
|
|
95
|
-
scopes: data.scope ? data.scope.split(" ") : [...scopes]
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
async function exchangeMSTeamsCodeForTokens(params) {
|
|
99
|
-
return await requestMSTeamsDelegatedTokens({
|
|
100
|
-
tenantId: params.tenantId,
|
|
101
|
-
clientId: params.clientId,
|
|
102
|
-
clientSecret: params.clientSecret,
|
|
103
|
-
grantType: "authorization_code",
|
|
104
|
-
scopes: params.scopes,
|
|
105
|
-
values: {
|
|
106
|
-
code: params.code,
|
|
107
|
-
redirect_uri: MSTEAMS_OAUTH_REDIRECT_URI,
|
|
108
|
-
code_verifier: params.verifier
|
|
109
|
-
},
|
|
110
|
-
auditContext: "msteams-oauth-token-exchange",
|
|
111
|
-
failureLabel: "token exchange",
|
|
112
|
-
resolveRefreshToken: (data) => {
|
|
113
|
-
if (!data.refresh_token) throw new Error("No refresh token received from Azure AD. Please try again.");
|
|
114
|
-
return data.refresh_token;
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
async function refreshMSTeamsDelegatedTokens(params) {
|
|
119
|
-
return await requestMSTeamsDelegatedTokens({
|
|
120
|
-
tenantId: params.tenantId,
|
|
121
|
-
clientId: params.clientId,
|
|
122
|
-
clientSecret: params.clientSecret,
|
|
123
|
-
grantType: "refresh_token",
|
|
124
|
-
scopes: params.scopes,
|
|
125
|
-
values: { refresh_token: params.refreshToken },
|
|
126
|
-
auditContext: "msteams-oauth-token-refresh",
|
|
127
|
-
failureLabel: "token refresh",
|
|
128
|
-
resolveRefreshToken: (data) => data.refresh_token ?? params.refreshToken
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
//#endregion
|
|
132
|
-
export { MSTEAMS_OAUTH_CALLBACK_PORT as a, createMSTeamsHttpError as c, MSTEAMS_OAUTH_CALLBACK_PATH as i, refreshMSTeamsDelegatedTokens as n, MSTEAMS_OAUTH_REDIRECT_URI as o, MSTEAMS_DEFAULT_DELEGATED_SCOPES as r, buildMSTeamsAuthEndpoint as s, exchangeMSTeamsCodeForTokens as t };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { mergeAllowlist, resolveAllowlistMatchSimple, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
2
|
-
import { createChannelMessageReplyPipeline, keepHttpServerTaskAlive, logTypingFailure } from "openclaw/plugin-sdk/channel-outbound";
|
|
3
|
-
import { createChannelPairingController } from "openclaw/plugin-sdk/channel-pairing";
|
|
4
|
-
import { resolveToolsBySender } from "openclaw/plugin-sdk/channel-policy";
|
|
5
|
-
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
6
|
-
import { PAIRING_APPROVED_MESSAGE, buildProbeChannelStatusSummary, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/channel-status";
|
|
7
|
-
import { buildChannelKeyCandidates, normalizeChannelSlug, resolveChannelEntryMatchWithFallback, resolveNestedAllowlistDecision } from "openclaw/plugin-sdk/channel-targets";
|
|
8
|
-
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
9
|
-
import { resolveDefaultGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
10
|
-
import { withFileLock as withFileLock$1 } from "openclaw/plugin-sdk/file-lock";
|
|
11
|
-
import { detectMime, extensionForMime, extractOriginalFilename, getFileExtension, resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
12
|
-
import { dispatchReplyFromConfigWithSettledDispatcher as dispatchReplyFromConfigWithSettledDispatcher$1 } from "openclaw/plugin-sdk/channel-inbound";
|
|
13
|
-
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
14
|
-
import { buildMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
15
|
-
import { fetchWithSsrFGuard as fetchWithSsrFGuard$1 } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
16
|
-
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
17
|
-
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
18
|
-
import { DEFAULT_WEBHOOK_MAX_BODY_BYTES } from "openclaw/plugin-sdk/webhook-ingress";
|
|
19
|
-
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
20
|
-
//#region extensions/msteams/src/runtime.ts
|
|
21
|
-
const { setRuntime: setMSTeamsRuntime, getRuntime: getMSTeamsRuntime, tryGetRuntime: getOptionalMSTeamsRuntime } = createPluginRuntimeStore({
|
|
22
|
-
pluginId: "msteams",
|
|
23
|
-
errorMessage: "MSTeams runtime not initialized"
|
|
24
|
-
});
|
|
25
|
-
//#endregion
|
|
26
|
-
export { summarizeMapping as A, normalizeStringEntries as C, resolveDefaultGroupPolicy as D, resolveChannelMediaMaxBytes as E, getMSTeamsRuntime as M, getOptionalMSTeamsRuntime as N, resolveNestedAllowlistDecision as O, setMSTeamsRuntime as P, normalizeChannelSlug as S, resolveChannelEntryMatchWithFallback as T, isDangerousNameMatchingEnabled as _, buildMediaPayload as a, logTypingFailure as b, createChannelMessageReplyPipeline as c, detectMime as d, dispatchReplyFromConfigWithSettledDispatcher$1 as f, getFileExtension as g, fetchWithSsrFGuard$1 as h, buildChannelKeyCandidates as i, withFileLock$1 as j, resolveToolsBySender as k, createChannelPairingController as l, extractOriginalFilename as m, DEFAULT_WEBHOOK_MAX_BODY_BYTES as n, buildProbeChannelStatusSummary as o, extensionForMime as p, PAIRING_APPROVED_MESSAGE as r, chunkTextForOutbound as s, DEFAULT_ACCOUNT_ID as t, createDefaultChannelRuntimeState as u, keepHttpServerTaskAlive as v, resolveAllowlistMatchSimple as w, mergeAllowlist as x, loadOutboundMediaFromUrl as y };
|