@openclaw/msteams 2026.8.1-beta.3 → 2026.8.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/{adapter.runtime-8g-MOPfb.cjs → adapter.runtime-DDuc7sKJ.cjs} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/approval-card-BEblaIto.cjs +303 -0
- package/dist/approval-handler.runtime-C0AWNWXk.cjs +107 -0
- package/dist/{channel-KpWENcgK.cjs → channel-DLn4b6Qi.cjs} +168 -53
- package/dist/channel-config-api.cjs +1 -1
- package/dist/channel-plugin-api.cjs +1 -1
- package/dist/{channel.runtime-Bkzj8jZ0.cjs → channel.runtime-1mH99ZAm.cjs} +49 -608
- package/dist/{channel.setup-mOFtsfYz.cjs → channel.setup-BRbhaigB.cjs} +29 -18
- package/dist/{config-schema-C4CszdDi.cjs → config-schema-MyN2lamA.cjs} +12 -11
- package/dist/configured-state.cjs +20 -0
- package/dist/directory-contract-api.cjs +1 -1
- package/dist/doctor-contract-api.cjs +79 -42
- package/dist/{messenger-IISPSOvj.cjs → messenger-flkiAkkB.cjs} +29 -171
- package/dist/{oauth-C9So7uld.cjs → oauth-Bctn-WPI.cjs} +4 -3
- package/dist/{polls-DvuJvaDG.cjs → polls-P86qBpeV.cjs} +5 -4
- package/dist/qa-runner-api.cjs +1 -1
- package/dist/reaction-types-CL79V_5D.cjs +150 -0
- package/dist/{resolve-allowlist-CIfWUwuc.cjs → resolve-allowlist-BrdWKHE-.cjs} +26 -51
- package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
- package/dist/runtime-api.cjs +2 -1
- package/dist/secret-input-C65t6kjM.cjs +1 -0
- package/dist/send-C4BjzS1F.cjs +631 -0
- package/dist/setup-plugin-api.cjs +1 -1
- package/dist/{src-C127-DcQ.cjs → src-RSjkJRjI.cjs} +237 -99
- package/dist/{sso-token-store-ChhO1f4i.cjs → sso-token-store-CNbRhz-A.cjs} +1 -1
- package/dist/thread-session-DxOri69r.cjs +63 -0
- package/package.json +13 -11
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
2
2
|
require("./runtime-api.cjs");
|
|
3
3
|
const require_delegated_state = require("./delegated-state-DiEz9JIa.cjs");
|
|
4
|
+
require("./secret-input-C65t6kjM.cjs");
|
|
4
5
|
let openclaw_plugin_sdk_lazy_runtime = require("openclaw/plugin-sdk/lazy-runtime");
|
|
5
6
|
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
6
7
|
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
@@ -14,12 +15,12 @@ let openclaw_plugin_sdk_number_runtime = require("openclaw/plugin-sdk/number-run
|
|
|
14
15
|
let openclaw_plugin_sdk_text_utility_runtime = require("openclaw/plugin-sdk/text-utility-runtime");
|
|
15
16
|
let openclaw_plugin_sdk_secret_file = require("openclaw/plugin-sdk/secret-file");
|
|
16
17
|
let node_module = require("node:module");
|
|
17
|
-
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
18
18
|
let openclaw_plugin_sdk_html_entity_runtime = require("openclaw/plugin-sdk/html-entity-runtime");
|
|
19
|
+
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
19
20
|
//#region extensions/msteams/src/request-timeout.ts
|
|
20
21
|
const MSTEAMS_REQUEST_TIMEOUT_MS = 3e4;
|
|
21
|
-
const MSTEAMS_SHAREPOINT_UPLOAD_BASE_TIMEOUT_MS =
|
|
22
|
-
const MSTEAMS_SHAREPOINT_UPLOAD_MIN_BYTES_PER_SECOND =
|
|
22
|
+
const MSTEAMS_SHAREPOINT_UPLOAD_BASE_TIMEOUT_MS = 3e5;
|
|
23
|
+
const MSTEAMS_SHAREPOINT_UPLOAD_MIN_BYTES_PER_SECOND = 262144;
|
|
23
24
|
const MSTEAMS_INBOUND_PREPROCESS_TIMEOUT_MS = 1e4;
|
|
24
25
|
function createMSTeamsInboundDeadline() {
|
|
25
26
|
return (0, openclaw_plugin_sdk_provider_http.createProviderOperationDeadline)({
|
|
@@ -110,25 +111,6 @@ const DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST = [
|
|
|
110
111
|
"graph.microsoft.cn"
|
|
111
112
|
];
|
|
112
113
|
const GRAPH_ROOT = "https://graph.microsoft.com/v1.0";
|
|
113
|
-
function estimateBase64DecodedBytes(base64) {
|
|
114
|
-
let effectiveLen = 0;
|
|
115
|
-
for (let i = 0; i < base64.length; i += 1) {
|
|
116
|
-
if (base64.charCodeAt(i) <= 32) continue;
|
|
117
|
-
effectiveLen += 1;
|
|
118
|
-
}
|
|
119
|
-
if (effectiveLen === 0) return 0;
|
|
120
|
-
let padding = 0;
|
|
121
|
-
let end = base64.length - 1;
|
|
122
|
-
while (end >= 0 && base64.charCodeAt(end) <= 32) end -= 1;
|
|
123
|
-
if (end >= 0 && base64[end] === "=") {
|
|
124
|
-
padding = 1;
|
|
125
|
-
end -= 1;
|
|
126
|
-
while (end >= 0 && base64.charCodeAt(end) <= 32) end -= 1;
|
|
127
|
-
if (end >= 0 && base64[end] === "=") padding = 2;
|
|
128
|
-
}
|
|
129
|
-
const estimated = Math.floor(effectiveLen * 3 / 4) - padding;
|
|
130
|
-
return Math.max(0, estimated);
|
|
131
|
-
}
|
|
132
114
|
/**
|
|
133
115
|
* Host suffixes for SharePoint/OneDrive shared links that must be fetched via
|
|
134
116
|
* the Graph `/shares/{shareId}/driveItem/content` endpoint instead of directly.
|
|
@@ -275,7 +257,7 @@ function decodeDataImageWithLimits(src, opts) {
|
|
|
275
257
|
candidate: null,
|
|
276
258
|
estimatedBytes: 0
|
|
277
259
|
};
|
|
278
|
-
const estimatedBytes =
|
|
260
|
+
const estimatedBytes = node_buffer.Buffer.byteLength(canonicalPayload, "base64");
|
|
279
261
|
if (estimatedBytes <= 0) return {
|
|
280
262
|
candidate: null,
|
|
281
263
|
estimatedBytes: 0
|
|
@@ -448,7 +430,7 @@ async function safeFetch(params) {
|
|
|
448
430
|
const resolveFn = params.resolveFn ?? node_dns_promises.lookup;
|
|
449
431
|
const hasDispatcher = Boolean(params.requestInit && typeof params.requestInit === "object" && "dispatcher" in params.requestInit);
|
|
450
432
|
const currentHeaders = new Headers(params.requestInit?.headers);
|
|
451
|
-
|
|
433
|
+
const currentUrl = params.url;
|
|
452
434
|
if (!isUrlAllowed(currentUrl, params.allowHosts)) throw new Error(`Initial download URL blocked: ${currentUrl}`);
|
|
453
435
|
if (currentHeaders.has("authorization") && params.authorizationAllowHosts && !isUrlAllowed(currentUrl, params.authorizationAllowHosts)) currentHeaders.delete("authorization");
|
|
454
436
|
if (!hasDispatcher) {
|
|
@@ -479,37 +461,29 @@ async function safeFetch(params) {
|
|
|
479
461
|
});
|
|
480
462
|
return (0, openclaw_plugin_sdk_fetch_runtime.responseWithRelease)(guarded.response, guarded.release);
|
|
481
463
|
}
|
|
482
|
-
|
|
464
|
+
try {
|
|
483
465
|
const initialHost = new URL(currentUrl).hostname;
|
|
484
466
|
await resolveAndValidateIP(initialHost, resolveFn);
|
|
485
467
|
} catch {
|
|
486
468
|
throw new Error(`Initial download URL blocked: ${currentUrl}`);
|
|
487
469
|
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
throw new Error(`Invalid redirect URL: ${location}`);
|
|
502
|
-
}
|
|
503
|
-
if (!isUrlAllowed(redirectUrl, params.allowHosts)) throw new Error(`Media redirect target blocked by allowlist: ${redirectUrl}`);
|
|
504
|
-
if (currentHeaders.has("authorization") && params.authorizationAllowHosts && !isUrlAllowed(redirectUrl, params.authorizationAllowHosts)) currentHeaders.delete("authorization");
|
|
505
|
-
if (hasDispatcher) return res;
|
|
506
|
-
if (resolveFn) {
|
|
507
|
-
const redirectHost = new URL(redirectUrl).hostname;
|
|
508
|
-
await resolveAndValidateIP(redirectHost, resolveFn);
|
|
509
|
-
}
|
|
510
|
-
currentUrl = redirectUrl;
|
|
470
|
+
const res = await (params.fetchFn ?? fetch)(currentUrl, {
|
|
471
|
+
...params.requestInit,
|
|
472
|
+
headers: currentHeaders,
|
|
473
|
+
redirect: "manual"
|
|
474
|
+
});
|
|
475
|
+
if (!isRedirectStatus(res.status)) return res;
|
|
476
|
+
const location = res.headers.get("location");
|
|
477
|
+
if (!location) return res;
|
|
478
|
+
let redirectUrl;
|
|
479
|
+
try {
|
|
480
|
+
redirectUrl = new URL(location, currentUrl).toString();
|
|
481
|
+
} catch {
|
|
482
|
+
throw new Error(`Invalid redirect URL: ${location}`);
|
|
511
483
|
}
|
|
512
|
-
throw new Error(`
|
|
484
|
+
if (!isUrlAllowed(redirectUrl, params.allowHosts)) throw new Error(`Media redirect target blocked by allowlist: ${redirectUrl}`);
|
|
485
|
+
if (currentHeaders.has("authorization") && params.authorizationAllowHosts && !isUrlAllowed(redirectUrl, params.authorizationAllowHosts)) currentHeaders.delete("authorization");
|
|
486
|
+
return res;
|
|
513
487
|
}
|
|
514
488
|
async function safeFetchWithPolicy(params) {
|
|
515
489
|
return await safeFetch({
|
|
@@ -919,7 +893,7 @@ function buildMSTeamsTokenEndpoint(tenantId) {
|
|
|
919
893
|
//#endregion
|
|
920
894
|
//#region extensions/msteams/src/oauth.token.ts
|
|
921
895
|
/** Five-minute buffer subtracted from token expiry to avoid edge-case clock drift. */
|
|
922
|
-
const EXPIRY_BUFFER_MS =
|
|
896
|
+
const EXPIRY_BUFFER_MS = 3e5;
|
|
923
897
|
function createMSTeamsTokenBody(params) {
|
|
924
898
|
const body = new URLSearchParams({
|
|
925
899
|
client_id: params.clientId,
|
|
@@ -1114,8 +1088,9 @@ function escapeOData(value) {
|
|
|
1114
1088
|
}
|
|
1115
1089
|
async function requestGraph(params) {
|
|
1116
1090
|
const hasBody = params.body !== void 0;
|
|
1091
|
+
const url = `${params.root ?? "https://graph.microsoft.com/v1.0"}${params.path}`;
|
|
1117
1092
|
const { response, release } = await (0, openclaw_plugin_sdk_ssrf_runtime.fetchWithSsrFGuard)({
|
|
1118
|
-
url
|
|
1093
|
+
url,
|
|
1119
1094
|
init: {
|
|
1120
1095
|
method: params.method,
|
|
1121
1096
|
headers: {
|
|
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
package/dist/runtime-api.cjs
CHANGED
|
@@ -11,6 +11,7 @@ let openclaw_plugin_sdk_dangerous_name_runtime = require("openclaw/plugin-sdk/da
|
|
|
11
11
|
let openclaw_plugin_sdk_runtime_group_policy = require("openclaw/plugin-sdk/runtime-group-policy");
|
|
12
12
|
let openclaw_plugin_sdk_file_lock = require("openclaw/plugin-sdk/file-lock");
|
|
13
13
|
let openclaw_plugin_sdk_media_runtime = require("openclaw/plugin-sdk/media-runtime");
|
|
14
|
+
let openclaw_plugin_sdk_account_helpers = require("openclaw/plugin-sdk/account-helpers");
|
|
14
15
|
let openclaw_plugin_sdk_outbound_media = require("openclaw/plugin-sdk/outbound-media");
|
|
15
16
|
let openclaw_plugin_sdk_reply_payload = require("openclaw/plugin-sdk/reply-payload");
|
|
16
17
|
let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
|
|
@@ -164,7 +165,7 @@ Object.defineProperty(exports, "resolveChannelEntryMatchWithFallback", {
|
|
|
164
165
|
Object.defineProperty(exports, "resolveChannelMediaMaxBytes", {
|
|
165
166
|
enumerable: true,
|
|
166
167
|
get: function() {
|
|
167
|
-
return
|
|
168
|
+
return openclaw_plugin_sdk_account_helpers.resolveChannelMediaMaxBytes;
|
|
168
169
|
}
|
|
169
170
|
});
|
|
170
171
|
Object.defineProperty(exports, "resolveDefaultGroupPolicy", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require("openclaw/plugin-sdk/secret-input");
|