@openclaw/gateway-client 2026.10.1-beta.2 → 2026.10.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/browser.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as resolveGatewayConnectScopes, B as buildDeviceAuthPayloadV3, C as isGatewayProtocolResponseError, D as gatewayOriginScope, E as gatewayCredentialScope, F as mergeChatStreamMessage, I as asNullableRecord, M as shouldRetryGatewayWithDeviceToken, O as GatewayBrowserDeviceAuthLifecycle, S as GatewayProtocolRequestTimeoutError, T as resolveModelCatalogConnect, V as normalizeDeviceMetadataForAuth, _ as readSessionMessageIdentity, a as createSessionProjection, b as GatewayProtocolClient, c as reduceSessionProjection, d as readSessionProjectionFinalMessageIdentity, f as isSessionProjectionErrorMessage, g as readAssistantStreamSegmentIdentity, h as normalizeSessionProjectionRunId, i as resetGatewaySessionMessageSubscriptionCoordinator, j as selectGatewayConnectAuth, k as buildGatewayConnectAuth, l as reduceSessionProjectionRunEvent, m as isLocallyOptimisticSessionMessage, n as getGatewaySessionMessageSubscriptionCoordinator, o as projectLiveSessionMessage, p as projectSessionTerminalReplyMessage, r as releaseGatewaySessionMessageSubscription, s as reconcileSessionProjectionSnapshot, t as GatewaySessionMessageSubscriptionCoordinator, u as hasSessionProjectionAcceptedFinal, v as readSessionMessageSequence, x as GatewayProtocolRequestError, y as shouldPauseGatewayReconnect, z as buildDeviceAuthPayload } from "./session-subscriptions-
|
|
1
|
+
import { A as resolveGatewayConnectScopes, B as buildDeviceAuthPayloadV3, C as isGatewayProtocolResponseError, D as gatewayOriginScope, E as gatewayCredentialScope, F as mergeChatStreamMessage, I as asNullableRecord, M as shouldRetryGatewayWithDeviceToken, O as GatewayBrowserDeviceAuthLifecycle, S as GatewayProtocolRequestTimeoutError, T as resolveModelCatalogConnect, V as normalizeDeviceMetadataForAuth, _ as readSessionMessageIdentity, a as createSessionProjection, b as GatewayProtocolClient, c as reduceSessionProjection, d as readSessionProjectionFinalMessageIdentity, f as isSessionProjectionErrorMessage, g as readAssistantStreamSegmentIdentity, h as normalizeSessionProjectionRunId, i as resetGatewaySessionMessageSubscriptionCoordinator, j as selectGatewayConnectAuth, k as buildGatewayConnectAuth, l as reduceSessionProjectionRunEvent, m as isLocallyOptimisticSessionMessage, n as getGatewaySessionMessageSubscriptionCoordinator, o as projectLiveSessionMessage, p as projectSessionTerminalReplyMessage, r as releaseGatewaySessionMessageSubscription, s as reconcileSessionProjectionSnapshot, t as GatewaySessionMessageSubscriptionCoordinator, u as hasSessionProjectionAcceptedFinal, v as readSessionMessageSequence, x as GatewayProtocolRequestError, y as shouldPauseGatewayReconnect, z as buildDeviceAuthPayload } from "./session-subscriptions-BmRgBWJk.mjs";
|
|
2
2
|
import { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, resolveSafeTimeoutDelayMs } from "./timeouts.mjs";
|
|
3
3
|
import { GATEWAY_SERVER_CAPS } from "@openclaw/gateway-protocol/frame-guards";
|
|
4
4
|
export * from "@openclaw/gateway-protocol/connect-error-details";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as resolveGatewayConnectScopes, B as buildDeviceAuthPayloadV3, C as isGatewayProtocolResponseError, D as gatewayOriginScope, E as gatewayCredentialScope, F as mergeChatStreamMessage, L as asRecord, M as shouldRetryGatewayWithDeviceToken, N as normalizeLowercaseStringOrEmpty, O as GatewayBrowserDeviceAuthLifecycle, P as normalizeOptionalString, R as isRecord, S as GatewayProtocolRequestTimeoutError, T as resolveModelCatalogConnect, V as normalizeDeviceMetadataForAuth, _ as readSessionMessageIdentity, a as createSessionProjection, b as GatewayProtocolClient, c as reduceSessionProjection, d as readSessionProjectionFinalMessageIdentity, f as isSessionProjectionErrorMessage, g as readAssistantStreamSegmentIdentity, h as normalizeSessionProjectionRunId, i as resetGatewaySessionMessageSubscriptionCoordinator, j as selectGatewayConnectAuth, k as buildGatewayConnectAuth, l as reduceSessionProjectionRunEvent, m as isLocallyOptimisticSessionMessage, n as getGatewaySessionMessageSubscriptionCoordinator, o as projectLiveSessionMessage, p as projectSessionTerminalReplyMessage, r as releaseGatewaySessionMessageSubscription, s as reconcileSessionProjectionSnapshot, t as GatewaySessionMessageSubscriptionCoordinator, u as hasSessionProjectionAcceptedFinal, v as readSessionMessageSequence, w as raceWithTimeout, x as GatewayProtocolRequestError, y as shouldPauseGatewayReconnect, z as buildDeviceAuthPayload } from "./session-subscriptions-
|
|
1
|
+
import { A as resolveGatewayConnectScopes, B as buildDeviceAuthPayloadV3, C as isGatewayProtocolResponseError, D as gatewayOriginScope, E as gatewayCredentialScope, F as mergeChatStreamMessage, L as asRecord, M as shouldRetryGatewayWithDeviceToken, N as normalizeLowercaseStringOrEmpty, O as GatewayBrowserDeviceAuthLifecycle, P as normalizeOptionalString, R as isRecord, S as GatewayProtocolRequestTimeoutError, T as resolveModelCatalogConnect, V as normalizeDeviceMetadataForAuth, _ as readSessionMessageIdentity, a as createSessionProjection, b as GatewayProtocolClient, c as reduceSessionProjection, d as readSessionProjectionFinalMessageIdentity, f as isSessionProjectionErrorMessage, g as readAssistantStreamSegmentIdentity, h as normalizeSessionProjectionRunId, i as resetGatewaySessionMessageSubscriptionCoordinator, j as selectGatewayConnectAuth, k as buildGatewayConnectAuth, l as reduceSessionProjectionRunEvent, m as isLocallyOptimisticSessionMessage, n as getGatewaySessionMessageSubscriptionCoordinator, o as projectLiveSessionMessage, p as projectSessionTerminalReplyMessage, r as releaseGatewaySessionMessageSubscription, s as reconcileSessionProjectionSnapshot, t as GatewaySessionMessageSubscriptionCoordinator, u as hasSessionProjectionAcceptedFinal, v as readSessionMessageSequence, w as raceWithTimeout, x as GatewayProtocolRequestError, y as shouldPauseGatewayReconnect, z as buildDeviceAuthPayload } from "./session-subscriptions-BmRgBWJk.mjs";
|
|
2
2
|
import { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, MAX_CONNECT_CHALLENGE_TIMEOUT_MS, MAX_SAFE_TIMEOUT_DELAY_MS, MIN_CONNECT_CHALLENGE_TIMEOUT_MS, addSafeTimeoutDelayGraceMs, clampConnectChallengeTimeoutMs, clearGatewayConnectTimeout, getConnectChallengeTimeoutMsFromEnv, resolveConnectChallengeTimeoutMs, resolveFiniteTimeoutDelayMs, resolvePreauthHandshakeTimeoutMs, resolveSafeTimeoutDelayMs, startGatewayConnectTimeout } from "./timeouts.mjs";
|
|
3
3
|
import { rawDataToString } from "./websocket-data.mjs";
|
|
4
4
|
import { n as startGatewayClientWithReadinessWait, r as waitForEventLoopReady, t as startGatewayClientWhenEventLoopReady } from "./readiness-DnB0NLBq.mjs";
|
|
@@ -309,20 +309,39 @@ function createAbortError(message, options) {
|
|
|
309
309
|
/** Bounds observation without cancelling work; a factory starts only after the timer is armed. */
|
|
310
310
|
async function raceWithTimeout(operation, timeoutMs, onTimeout, options = {}) {
|
|
311
311
|
let timer;
|
|
312
|
+
let onAbort;
|
|
312
313
|
try {
|
|
313
314
|
const deadline = new Promise((resolve, reject) => {
|
|
314
|
-
|
|
315
|
+
const settle = (result) => {
|
|
315
316
|
try {
|
|
316
|
-
resolve(
|
|
317
|
+
resolve(result());
|
|
317
318
|
} catch (error) {
|
|
318
319
|
reject(error);
|
|
319
320
|
}
|
|
320
|
-
}
|
|
321
|
+
};
|
|
322
|
+
timer = setTimeout(() => settle(onTimeout), timeoutMs);
|
|
321
323
|
if (options.ref === false) timer.unref?.();
|
|
324
|
+
const signal = options.signal;
|
|
325
|
+
if (signal) {
|
|
326
|
+
onAbort = () => settle(() => {
|
|
327
|
+
if (options.onAbort) return options.onAbort(signal);
|
|
328
|
+
throw createAbortError("Operation aborted", { cause: signal.reason });
|
|
329
|
+
});
|
|
330
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
331
|
+
if (signal.aborted) onAbort();
|
|
332
|
+
}
|
|
322
333
|
});
|
|
323
|
-
|
|
334
|
+
let source;
|
|
335
|
+
try {
|
|
336
|
+
source = typeof operation === "function" ? operation() : operation;
|
|
337
|
+
} catch (error) {
|
|
338
|
+
deadline.catch(() => {});
|
|
339
|
+
throw error;
|
|
340
|
+
}
|
|
341
|
+
return await Promise.race([source, deadline]);
|
|
324
342
|
} finally {
|
|
325
343
|
clearTimeout(timer);
|
|
344
|
+
if (onAbort) options.signal?.removeEventListener("abort", onAbort);
|
|
326
345
|
}
|
|
327
346
|
}
|
|
328
347
|
function computeBackoff(policy, attempt) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/gateway-client",
|
|
3
|
-
"version": "2026.10.1
|
|
3
|
+
"version": "2026.10.1",
|
|
4
4
|
"description": "Reference WebSocket client for the OpenClaw Gateway protocol",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@openclaw/gateway-protocol": "2026.10.1
|
|
65
|
+
"@openclaw/gateway-protocol": "2026.10.1",
|
|
66
66
|
"ipaddr.js": "2.5.0",
|
|
67
67
|
"ws": "8.21.3"
|
|
68
68
|
},
|