@wecom/wecom-openclaw-plugin 2026.4.29 → 2026.5.7-beta.0

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.
@@ -10,6 +10,7 @@
10
10
  * - MCP 配置运行时缓存(通过 WSClient 拉取 URL 并缓存在内存中)
11
11
  */
12
12
  import { generateReqId } from "@wecom/aibot-node-sdk";
13
+ import { fetch as undiciFetch } from "undici";
13
14
  import { DEFAULT_ACCOUNT_ID } from "../openclaw-compat.js";
14
15
  import { getWeComWebSocket } from "../state-manager.js";
15
16
  import { MCP_GET_CONFIG_CMD, MCP_CONFIG_FETCH_TIMEOUT_MS } from "../const.js";
@@ -242,12 +243,14 @@ async function sendRawJsonRpc(url, session, body, timeoutMs = HTTP_REQUEST_TIMEO
242
243
  console.log(`${LOG_TAG} sendRawJsonRpc → ${body.method} | ${WECOM_USERID_HEADER}: ${headers[WECOM_USERID_HEADER] ?? "(not set)"}`);
243
244
  let response;
244
245
  try {
245
- response = await fetch(url, {
246
+ // 使用 undici 提供的 fetch,规避 Node 18.0–18.17 原生 fetch 无法自定义 User-Agent 的 bug;
247
+ // undici 是项目已有依赖,且在所有支持的 Node 版本上行为一致。
248
+ response = (await undiciFetch(url, {
246
249
  method: "POST",
247
250
  headers,
248
251
  body: JSON.stringify(body),
249
252
  signal: controller.signal,
250
- });
253
+ }));
251
254
  }
252
255
  catch (err) {
253
256
  if (err instanceof DOMException && err.name === "AbortError") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wecom/wecom-openclaw-plugin",
3
- "version": "2026.4.29",
3
+ "version": "2026.5.7-beta.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -23,6 +23,7 @@
23
23
  "prebuild": "npm run clean",
24
24
  "release": "node scripts/publish-all.mjs",
25
25
  "release:dry": "node scripts/publish-all.mjs --dry-run",
26
+ "release:ci": "node scripts/publish-all.mjs --yes --restore=no",
26
27
  "deploy:local": "bash scripts/dev-deploy.sh"
27
28
  },
28
29
  "keywords": [
@@ -67,5 +68,13 @@
67
68
  "file-type": "^21.3.0",
68
69
  "undici": "^7.24.6",
69
70
  "zod": "^4.3.6"
71
+ },
72
+ "peerDependencies": {
73
+ "openclaw": ">=2026.3.28"
74
+ },
75
+ "peerDependenciesMeta": {
76
+ "openclaw": {
77
+ "optional": true
78
+ }
70
79
  }
71
80
  }