@openclaw/gateway-client 2026.8.1-beta.1 → 2026.8.1-beta.3

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/timeouts.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region packages/gateway-client/src/timeouts.ts
2
- function parseStrictPositiveInteger(value) {
2
+ function parsePositiveTimeoutSetting(value) {
3
3
  const trimmed = value.trim();
4
4
  if (!/^\+?\d+$/u.test(trimmed)) return;
5
5
  const parsed = Number(trimmed);
@@ -53,7 +53,7 @@ function clampConnectChallengeTimeoutMs(timeoutMs, maxTimeoutMs = MAX_CONNECT_CH
53
53
  function getConnectChallengeTimeoutMsFromEnv(env = process.env) {
54
54
  const raw = env.OPENCLAW_CONNECT_CHALLENGE_TIMEOUT_MS;
55
55
  if (raw) {
56
- const parsed = parseStrictPositiveInteger(raw);
56
+ const parsed = parsePositiveTimeoutSetting(raw);
57
57
  if (parsed !== void 0) return resolveSafeTimeoutDelayMs(parsed);
58
58
  }
59
59
  }
@@ -77,7 +77,7 @@ function resolvePreauthHandshakeTimeoutMs(params) {
77
77
  const env = params?.env ?? process.env;
78
78
  const configuredTimeout = env.OPENCLAW_HANDSHAKE_TIMEOUT_MS || (isTestRuntimeEnv(env) ? env.OPENCLAW_TEST_HANDSHAKE_TIMEOUT_MS : void 0);
79
79
  if (configuredTimeout) {
80
- const parsed = parseStrictPositiveInteger(configuredTimeout);
80
+ const parsed = parsePositiveTimeoutSetting(configuredTimeout);
81
81
  if (parsed !== void 0) return resolveSafeTimeoutDelayMs(parsed);
82
82
  }
83
83
  const configured = normalizePositiveTimeoutMs(params?.configuredTimeoutMs);
@@ -0,0 +1,6 @@
1
+ import { RawData } from "ws";
2
+
3
+ //#region packages/gateway-client/src/websocket-data.d.ts
4
+ declare function rawDataToString(data: RawData, encoding?: BufferEncoding): string;
5
+ //#endregion
6
+ export { rawDataToString };
@@ -0,0 +1,8 @@
1
+ import { Buffer } from "node:buffer";
2
+ //#region packages/gateway-client/src/websocket-data.ts
3
+ function rawDataToString(data, encoding = "utf8") {
4
+ if (Array.isArray(data)) return Buffer.concat(data).toString(encoding);
5
+ return data instanceof ArrayBuffer ? Buffer.from(data).toString(encoding) : data.toString(encoding);
6
+ }
7
+ //#endregion
8
+ export { rawDataToString };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/gateway-client",
3
- "version": "2026.8.1-beta.1",
3
+ "version": "2026.8.1-beta.3",
4
4
  "description": "Reference WebSocket client for the OpenClaw Gateway protocol",
5
5
  "keywords": [
6
6
  "client",
@@ -45,16 +45,29 @@
45
45
  "import": "./dist/readiness.mjs",
46
46
  "default": "./dist/readiness.mjs"
47
47
  },
48
+ "./scope-upgrade": {
49
+ "types": "./dist/scope-upgrade.d.mts",
50
+ "import": "./dist/scope-upgrade.mjs",
51
+ "default": "./dist/scope-upgrade.mjs"
52
+ },
48
53
  "./timeouts": {
49
54
  "types": "./dist/timeouts.d.mts",
50
55
  "import": "./dist/timeouts.mjs",
51
56
  "default": "./dist/timeouts.mjs"
57
+ },
58
+ "./websocket-data": {
59
+ "types": "./dist/websocket-data.d.mts",
60
+ "import": "./dist/websocket-data.mjs",
61
+ "default": "./dist/websocket-data.mjs"
52
62
  }
53
63
  },
54
64
  "dependencies": {
55
65
  "ipaddr.js": "2.4.0",
56
66
  "ws": "8.21.1",
57
- "@openclaw/gateway-protocol": "2026.8.1-beta.1"
67
+ "@openclaw/gateway-protocol": "2026.8.1-beta.3"
68
+ },
69
+ "devDependencies": {
70
+ "@openclaw/normalization-core": "0.0.0-private"
58
71
  },
59
72
  "engines": {
60
73
  "node": ">=22.19.0"
@@ -68,6 +81,6 @@
68
81
  }
69
82
  },
70
83
  "scripts": {
71
- "build": "tsdown src/index.ts src/browser.ts src/readiness.ts src/timeouts.ts --no-config --platform node --format esm --dts --out-dir dist --clean"
84
+ "build": "tsdown src/index.ts src/browser.ts src/readiness.ts src/scope-upgrade.ts src/timeouts.ts src/websocket-data.ts --no-config --platform node --format esm --dts --out-dir dist --clean"
72
85
  }
73
86
  }