@openclaw/gateway-client 2026.8.1-beta.2 → 2026.8.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.
@@ -1,3 +1,4 @@
1
+ import { n as GatewayProtocolRequestOptions } from "./protocol-request-CcYZeK09.mjs";
1
2
  //#region packages/gateway-client/src/device-auth.d.ts
2
3
  declare function normalizeDeviceMetadataForAuth(value?: string | null): string;
3
4
  type DeviceAuthPayloadParams = {
@@ -23,8 +24,7 @@ declare function gatewayOriginScope(gatewayUrl: string): string;
23
24
  /** Normalizes the gateway URL scope used for browser credential records. */
24
25
  declare function gatewayCredentialScope(gatewayUrl: string): string;
25
26
  //#endregion
26
- //#region packages/gateway-client/src/session-projection.d.ts
27
- /** Browser-safe identity and replay rules shared by Gateway conversation clients. */
27
+ //#region packages/gateway-client/src/session-projection-message-identity.d.ts
28
28
  type SessionMessageEnvelope = {
29
29
  messageId?: unknown;
30
30
  messageSeq?: unknown;
@@ -41,6 +41,14 @@ type SessionMessageIdentity = {
41
41
  isImported: boolean;
42
42
  externalSource: string | null;
43
43
  };
44
+ /** History and status markers carry transcript order even when they have no chat role. */
45
+ declare function readSessionMessageSequence(message: unknown, envelope?: SessionMessageEnvelope): number | null;
46
+ /** Run ownership normalizes a user-turn suffix without changing its persisted send key. */
47
+ declare function normalizeSessionProjectionRunId(value: unknown): string | null;
48
+ /** Persisted row facts win; assistant run ownership comes from its authoritative producer. */
49
+ declare function readSessionMessageIdentity(message: unknown, envelope?: SessionMessageEnvelope): SessionMessageIdentity | null;
50
+ //#endregion
51
+ //#region packages/gateway-client/src/session-projection.d.ts
44
52
  type SessionProjectionScope = {
45
53
  sessionKey?: string;
46
54
  sessionId?: string;
@@ -122,12 +130,6 @@ type SessionProjectionEvent = ScopedSessionProjectionEvent & ({
122
130
  } | {
123
131
  type: "reconnected";
124
132
  });
125
- /** History and status markers carry transcript order even when they have no chat role. */
126
- declare function readSessionMessageSequence(message: unknown, envelope?: SessionMessageEnvelope): number | null;
127
- /** Run ownership normalizes a user-turn suffix without changing its persisted send key. */
128
- declare function normalizeSessionProjectionRunId(value: unknown): string | null;
129
- /** Persisted transcript facts win over envelope projections and provider-local import IDs. */
130
- declare function readSessionMessageIdentity(message: unknown, envelope?: SessionMessageEnvelope): SessionMessageIdentity | null;
131
133
  /** Local turns have no durable transcript metadata beyond their own optional send key. */
132
134
  declare function isLocallyOptimisticSessionMessage(message: unknown): boolean;
133
135
  declare function createSessionProjection(scope?: SessionProjectionScope, messages?: readonly unknown[]): SessionProjectionState;
@@ -143,7 +145,7 @@ declare function reduceSessionProjectionRunEvent(projection: SessionProjectionSt
143
145
  //#endregion
144
146
  //#region packages/gateway-client/src/session-subscriptions.d.ts
145
147
  type GatewaySessionMessageRequestClient = {
146
- request<T = unknown>(method: string, params: Record<string, unknown>): Promise<T>;
148
+ request<T = unknown>(method: string, params: Record<string, unknown>, options?: GatewayProtocolRequestOptions): Promise<T>;
147
149
  };
148
150
  type GatewaySessionMessageSubscription = {
149
151
  key: string;
@@ -175,4 +177,4 @@ declare function getGatewaySessionMessageSubscriptionCoordinator(client: Gateway
175
177
  declare function resetGatewaySessionMessageSubscriptionCoordinator(client: GatewaySessionMessageRequestClient): void;
176
178
  declare function releaseGatewaySessionMessageSubscription(subscription: GatewaySessionMessageSubscription): Promise<void>;
177
179
  //#endregion
178
- export { gatewayCredentialScope as A, normalizeSessionProjectionRunId as C, reconcileSessionProjectionSnapshot as D, readSessionMessageSequence as E, buildDeviceAuthPayload as M, buildDeviceAuthPayloadV3 as N, reduceSessionProjection as O, normalizeDeviceMetadataForAuth as P, isLocallyOptimisticSessionMessage as S, readSessionMessageIdentity as T, SessionProjectionScope as _, GatewaySessionMessageSubscriptionOptions as a, createSessionProjection as b, resetGatewaySessionMessageSubscriptionCoordinator as c, SessionProjectionEntry as d, SessionProjectionEvent as f, SessionProjectionRunTransition as g, SessionProjectionRunStatus as h, GatewaySessionMessageSubscriptionCoordinatorOptions as i, gatewayOriginScope as j, reduceSessionProjectionRunEvent as k, SessionMessageEnvelope as l, SessionProjectionRun as m, GatewaySessionMessageSubscription as n, getGatewaySessionMessageSubscriptionCoordinator as o, SessionProjectionGatewayRunEvent as p, GatewaySessionMessageSubscriptionCoordinator as r, releaseGatewaySessionMessageSubscription as s, GatewaySessionMessageRequestClient as t, SessionMessageIdentity as u, SessionProjectionSnapshotOptions as v, projectLiveSessionMessage as w, hasSessionProjectionAcceptedFinal as x, SessionProjectionState as y };
180
+ export { gatewayCredentialScope as A, reduceSessionProjection as C, normalizeSessionProjectionRunId as D, SessionMessageIdentity as E, buildDeviceAuthPayload as M, buildDeviceAuthPayloadV3 as N, readSessionMessageIdentity as O, normalizeDeviceMetadataForAuth as P, reconcileSessionProjectionSnapshot as S, SessionMessageEnvelope as T, SessionProjectionState as _, GatewaySessionMessageSubscriptionOptions as a, isLocallyOptimisticSessionMessage as b, resetGatewaySessionMessageSubscriptionCoordinator as c, SessionProjectionGatewayRunEvent as d, SessionProjectionRun as f, SessionProjectionSnapshotOptions as g, SessionProjectionScope as h, GatewaySessionMessageSubscriptionCoordinatorOptions as i, gatewayOriginScope as j, readSessionMessageSequence as k, SessionProjectionEntry as l, SessionProjectionRunTransition as m, GatewaySessionMessageSubscription as n, getGatewaySessionMessageSubscriptionCoordinator as o, SessionProjectionRunStatus as p, GatewaySessionMessageSubscriptionCoordinator as r, releaseGatewaySessionMessageSubscription as s, GatewaySessionMessageRequestClient as t, SessionProjectionEvent as u, createSessionProjection as v, reduceSessionProjectionRunEvent as w, projectLiveSessionMessage as x, hasSessionProjectionAcceptedFinal as y };
@@ -1,43 +1,42 @@
1
1
  //#region packages/gateway-client/src/timeouts.d.ts
2
2
  /** Maximum delay Node timers can represent without overflow warnings. */
3
- declare const MAX_SAFE_TIMEOUT_DELAY_MS = 2147483647;
3
+ export declare const MAX_SAFE_TIMEOUT_DELAY_MS = 2147483647;
4
4
  /** Default server-side window for gateway preauth handshakes. */
5
- declare const DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS = 15000;
5
+ export declare const DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS = 15000;
6
6
  /** Starts the browser-safe deadline that covers Gateway connect preparation and hello. */
7
- declare function startGatewayConnectTimeout(onTimeout: () => void): ReturnType<typeof setTimeout>;
7
+ export declare function startGatewayConnectTimeout(onTimeout: () => void): ReturnType<typeof setTimeout>;
8
8
  /** Clears either pending Gateway handshake phase without retaining its timer. */
9
- declare function clearGatewayConnectTimeout(timer: ReturnType<typeof setTimeout> | null): null;
9
+ export declare function clearGatewayConnectTimeout(timer: ReturnType<typeof setTimeout> | null): null;
10
10
  /** Default deadline for a single non-streaming Gateway request. */
11
- declare const DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS = 30000;
11
+ export declare const DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS = 30000;
12
12
  /** Minimum client watchdog delay for connect challenge setup. */
13
- declare const MIN_CONNECT_CHALLENGE_TIMEOUT_MS = 250;
13
+ export declare const MIN_CONNECT_CHALLENGE_TIMEOUT_MS = 250;
14
14
  /** Default maximum client watchdog delay, aligned with the preauth server timeout. */
15
- declare const MAX_CONNECT_CHALLENGE_TIMEOUT_MS = 15000;
15
+ export declare const MAX_CONNECT_CHALLENGE_TIMEOUT_MS = 15000;
16
16
  /** Clamps arbitrary timer delays to Node's safe range and an optional floor. */
17
- declare function resolveSafeTimeoutDelayMs(delayMs: number, opts?: {
17
+ export declare function resolveSafeTimeoutDelayMs(delayMs: number, opts?: {
18
18
  minMs?: number;
19
19
  }): number;
20
20
  /** Adds grace time while preserving safe timer bounds if inputs overflow or are invalid. */
21
- declare function addSafeTimeoutDelayGraceMs(delayMs: number, graceMs: number, opts?: {
21
+ export declare function addSafeTimeoutDelayGraceMs(delayMs: number, graceMs: number, opts?: {
22
22
  minMs?: number;
23
23
  }): number;
24
24
  /** Resolves optional timeout values through a fallback and safe timer clamp. */
25
- declare function resolveFiniteTimeoutDelayMs(delayMs: number | null | undefined, fallbackMs: number, opts?: {
25
+ export declare function resolveFiniteTimeoutDelayMs(delayMs: number | null | undefined, fallbackMs: number, opts?: {
26
26
  minMs?: number;
27
27
  }): number;
28
28
  /** Clamps connect challenge watchdog timeouts to the gateway-supported range. */
29
- declare function clampConnectChallengeTimeoutMs(timeoutMs: number, maxTimeoutMs?: number): number;
29
+ export declare function clampConnectChallengeTimeoutMs(timeoutMs: number, maxTimeoutMs?: number): number;
30
30
  /** Reads the connect challenge watchdog override from the process environment. */
31
- declare function getConnectChallengeTimeoutMsFromEnv(env?: NodeJS.ProcessEnv): number | undefined;
31
+ export declare function getConnectChallengeTimeoutMsFromEnv(env?: NodeJS.ProcessEnv): number | undefined;
32
32
  /** Resolves the client watchdog timeout using explicit, env, then preauth defaults. */
33
- declare function resolveConnectChallengeTimeoutMs(timeoutMs?: number | null, params?: {
33
+ export declare function resolveConnectChallengeTimeoutMs(timeoutMs?: number | null, params?: {
34
34
  env?: NodeJS.ProcessEnv;
35
35
  configuredTimeoutMs?: number | null;
36
36
  }): number;
37
37
  /** Resolves the server preauth timeout from env, explicit config, or default. */
38
- declare function resolvePreauthHandshakeTimeoutMs(params?: {
38
+ export declare function resolvePreauthHandshakeTimeoutMs(params?: {
39
39
  env?: NodeJS.ProcessEnv;
40
40
  configuredTimeoutMs?: number | null;
41
41
  }): number;
42
- //#endregion
43
- export { 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 };
42
+ //#endregion
@@ -1,6 +1,4 @@
1
1
  import { RawData } from "ws";
2
-
3
2
  //#region packages/gateway-client/src/websocket-data.d.ts
4
- declare function rawDataToString(data: RawData, encoding?: BufferEncoding): string;
5
- //#endregion
6
- export { rawDataToString };
3
+ export declare function rawDataToString(data: RawData, encoding?: BufferEncoding): string;
4
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/gateway-client",
3
- "version": "2026.8.1-beta.2",
3
+ "version": "2026.8.1",
4
4
  "description": "Reference WebSocket client for the OpenClaw Gateway protocol",
5
5
  "keywords": [
6
6
  "client",
@@ -62,9 +62,12 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "ipaddr.js": "2.4.0",
66
- "ws": "8.21.1",
67
- "@openclaw/gateway-protocol": "2026.8.1-beta.2"
65
+ "@openclaw/gateway-protocol": "2026.8.1",
66
+ "ipaddr.js": "2.5.0",
67
+ "ws": "8.21.3"
68
+ },
69
+ "devDependencies": {
70
+ "@openclaw/normalization-core": "0.0.0-private"
68
71
  },
69
72
  "engines": {
70
73
  "node": ">=22.19.0"