@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/README.md +15 -3
- package/dist/browser-device-auth-Dz6H7eXy.d.mts +112 -0
- package/dist/browser.d.mts +5 -3
- package/dist/browser.mjs +2 -2
- package/dist/index.d.mts +16 -3
- package/dist/index.mjs +653 -1136
- package/dist/{protocol-client-U142L0j3.d.mts → protocol-client-BbN-I582.d.mts} +15 -30
- package/dist/protocol-request-D4mVhLxE.d.mts +32 -0
- package/dist/{readiness-uSDrqxDM.d.mts → readiness-JllUDKLg.d.mts} +28 -14
- package/dist/readiness.d.mts +1 -1
- package/dist/scope-upgrade.d.mts +38 -0
- package/dist/scope-upgrade.mjs +73 -0
- package/dist/{session-subscriptions-Das1PATe.d.mts → session-subscriptions-CKF7acYN.d.mts} +17 -119
- package/dist/{session-subscriptions-D4Xv60cN.mjs → session-subscriptions-OJnDJHPL.mjs} +336 -191
- package/dist/timeouts.mjs +3 -3
- package/dist/websocket-data.d.mts +6 -0
- package/dist/websocket-data.mjs +8 -0
- package/package.json +16 -3
package/README.md
CHANGED
|
@@ -5,16 +5,23 @@ connection state machine used by OpenClaw's own Node and browser clients:
|
|
|
5
5
|
challenge-based authentication, typed protocol frames, request correlation,
|
|
6
6
|
timeouts, reconnect backoff, device-token handling, and event delivery.
|
|
7
7
|
|
|
8
|
-
The current wire protocol is version 4. General clients must
|
|
8
|
+
The current wire protocol is version 4. General clients must advertise exactly v4 with
|
|
9
9
|
`minProtocol: 4` and `maxProtocol: 4`. See the
|
|
10
10
|
[Gateway protocol specification](https://docs.openclaw.ai/gateway/protocol) for
|
|
11
11
|
the complete handshake, authentication, role, scope, and method contracts.
|
|
12
|
+
Exact node identities (`role: "node"` plus `mode: "node"`) and probe clients
|
|
13
|
+
can use v3. The built-in node host starts with an exact v4 envelope, then retries
|
|
14
|
+
an exact v3 envelope after a v3 Gateway rejects v4. If that legacy probe reaches
|
|
15
|
+
an upgraded v4 Gateway, the client reconnects with the full v4 envelope before
|
|
16
|
+
reporting readiness. Other exact node identities default to `[3, 4]`. Explicit
|
|
17
|
+
bounds override these defaults; `[3, 4]` on the built-in node host selects the
|
|
18
|
+
same bounded negotiation.
|
|
12
19
|
|
|
13
20
|
## Versioning
|
|
14
21
|
|
|
15
22
|
Package versions follow the OpenClaw calendar release train: `YYYY.M.PATCH`,
|
|
16
23
|
including the OpenClaw prerelease suffix when applicable. The package version is
|
|
17
|
-
separate from the
|
|
24
|
+
separate from the Gateway's current wire protocol number reported in `hello-ok`.
|
|
18
25
|
|
|
19
26
|
## Install
|
|
20
27
|
|
|
@@ -37,6 +44,8 @@ client surface.
|
|
|
37
44
|
until the event loop can process Gateway IO.
|
|
38
45
|
- `@openclaw/gateway-client/timeouts` exports timeout constants and safe timer
|
|
39
46
|
resolution helpers.
|
|
47
|
+
- `@openclaw/gateway-client/websocket-data` converts every Node `ws` raw-data
|
|
48
|
+
shape to UTF-8 text.
|
|
40
49
|
|
|
41
50
|
## Node quickstart
|
|
42
51
|
|
|
@@ -69,7 +78,7 @@ client.stop();
|
|
|
69
78
|
The client waits for the Gateway's `connect.challenge` event before sending its
|
|
70
79
|
`connect` request. It includes the challenge nonce in device authentication and
|
|
71
80
|
does not fall back to a pre-challenge handshake. `onHelloOk` fires only after the
|
|
72
|
-
Gateway accepts
|
|
81
|
+
Gateway accepts a compatible connection, so requests should wait for that callback.
|
|
73
82
|
|
|
74
83
|
For remote connections, use `wss://`. Plaintext `ws://` is allowed by default
|
|
75
84
|
only for loopback addresses. Authentication material and Gateway traffic must
|
|
@@ -129,6 +138,9 @@ from `@openclaw/gateway-protocol`, not from bundled implementation paths.
|
|
|
129
138
|
the socket; `stop()` closes it and rejects pending requests.
|
|
130
139
|
- A request uses `request(method, params)` after `hello-ok`. Passing
|
|
131
140
|
`timeoutMs: null` creates an intentionally unbounded request.
|
|
141
|
+
- Finite request deadlines reject with `GatewayProtocolRequestTimeoutError`,
|
|
142
|
+
whose `CLIENT_TIMEOUT` code, method, deadline, and send-boundary flag remain
|
|
143
|
+
distinct from authoritative Gateway response errors.
|
|
132
144
|
- Device identity persistence, signing, proxy routing, TLS formatting, and
|
|
133
145
|
logging stay host-owned through `GatewayClientHostDeps`.
|
|
134
146
|
- Protocol changes are additive first. Incompatible changes require an explicit
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ConnectParams, HelloOk } from "@openclaw/gateway-protocol";
|
|
2
|
+
|
|
3
|
+
//#region packages/gateway-client/src/connect-auth.d.ts
|
|
4
|
+
type GatewayConnectAuthSelection = {
|
|
5
|
+
authToken?: string;
|
|
6
|
+
authBootstrapToken?: string;
|
|
7
|
+
authDeviceToken?: string;
|
|
8
|
+
authPassword?: string;
|
|
9
|
+
authApprovalRuntimeToken?: string;
|
|
10
|
+
authAgentRuntimeIdentityToken?: string;
|
|
11
|
+
signatureToken?: string;
|
|
12
|
+
resolvedDeviceToken?: string;
|
|
13
|
+
storedToken?: string;
|
|
14
|
+
storedScopes?: string[];
|
|
15
|
+
usingStoredDeviceToken?: boolean;
|
|
16
|
+
};
|
|
17
|
+
declare function selectGatewayConnectAuth(params: {
|
|
18
|
+
token?: string;
|
|
19
|
+
bootstrapToken?: string;
|
|
20
|
+
deviceToken?: string;
|
|
21
|
+
password?: string;
|
|
22
|
+
approvalRuntimeToken?: string;
|
|
23
|
+
agentRuntimeIdentityToken?: string;
|
|
24
|
+
storedToken?: string;
|
|
25
|
+
storedScopes?: string[];
|
|
26
|
+
pendingDeviceTokenRetry?: boolean;
|
|
27
|
+
trustedDeviceTokenRetry?: boolean;
|
|
28
|
+
preferBootstrapToken?: boolean;
|
|
29
|
+
}): GatewayConnectAuthSelection;
|
|
30
|
+
declare function buildGatewayConnectAuth(selected: GatewayConnectAuthSelection): ConnectParams["auth"];
|
|
31
|
+
declare function resolveGatewayConnectScopes(params: {
|
|
32
|
+
requestedScopes?: string[];
|
|
33
|
+
usingStoredDeviceToken?: boolean;
|
|
34
|
+
storedScopes?: string[];
|
|
35
|
+
defaultScopes: readonly string[];
|
|
36
|
+
}): string[];
|
|
37
|
+
declare function shouldRetryGatewayWithDeviceToken(params: {
|
|
38
|
+
retryBudgetUsed: boolean;
|
|
39
|
+
currentDeviceToken?: string;
|
|
40
|
+
explicitToken?: string;
|
|
41
|
+
storedToken?: string;
|
|
42
|
+
trustedEndpoint: boolean;
|
|
43
|
+
canRetryWithDeviceTokenHint?: boolean;
|
|
44
|
+
errorDetails?: unknown;
|
|
45
|
+
}): boolean;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region packages/gateway-client/src/browser-device-auth.d.ts
|
|
48
|
+
type GatewayBrowserDeviceIdentity = {
|
|
49
|
+
deviceId: string;
|
|
50
|
+
publicKey: string;
|
|
51
|
+
sign: (payload: string) => Promise<string>;
|
|
52
|
+
};
|
|
53
|
+
type GatewayBrowserDeviceTokenRecord = {
|
|
54
|
+
token: string;
|
|
55
|
+
scopes: string[];
|
|
56
|
+
};
|
|
57
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
58
|
+
type GatewayBrowserDeviceTokenStore = {
|
|
59
|
+
load: (params: {
|
|
60
|
+
clientId: string;
|
|
61
|
+
deviceId: string;
|
|
62
|
+
role: string;
|
|
63
|
+
}) => MaybePromise<GatewayBrowserDeviceTokenRecord | null>;
|
|
64
|
+
store: (params: {
|
|
65
|
+
clientId: string;
|
|
66
|
+
deviceId: string;
|
|
67
|
+
role: string;
|
|
68
|
+
token: string;
|
|
69
|
+
scopes: string[];
|
|
70
|
+
}) => MaybePromise<void>;
|
|
71
|
+
clear: (params: {
|
|
72
|
+
clientId: string;
|
|
73
|
+
deviceId: string;
|
|
74
|
+
role: string;
|
|
75
|
+
}) => MaybePromise<void>;
|
|
76
|
+
};
|
|
77
|
+
type GatewayBrowserDeviceAuthPlan = {
|
|
78
|
+
clientId: string;
|
|
79
|
+
role: string;
|
|
80
|
+
identity: GatewayBrowserDeviceIdentity | null;
|
|
81
|
+
selectedAuth: GatewayConnectAuthSelection;
|
|
82
|
+
scopes: string[];
|
|
83
|
+
device?: NonNullable<ConnectParams["device"]>;
|
|
84
|
+
auth?: ConnectParams["auth"];
|
|
85
|
+
};
|
|
86
|
+
/** Browser-safe device pairing and issued-token lifecycle shared by first-party UI clients. */
|
|
87
|
+
declare class GatewayBrowserDeviceAuthLifecycle {
|
|
88
|
+
private readonly deps;
|
|
89
|
+
constructor(deps: {
|
|
90
|
+
loadIdentity: () => Promise<GatewayBrowserDeviceIdentity | null>;
|
|
91
|
+
tokenStore: GatewayBrowserDeviceTokenStore;
|
|
92
|
+
nowMs?: () => number;
|
|
93
|
+
});
|
|
94
|
+
buildPlan(params: {
|
|
95
|
+
client: ConnectParams["client"];
|
|
96
|
+
role: string;
|
|
97
|
+
defaultScopes: readonly string[];
|
|
98
|
+
bootstrapScopes?: readonly string[];
|
|
99
|
+
token?: string;
|
|
100
|
+
bootstrapToken?: string;
|
|
101
|
+
password?: string;
|
|
102
|
+
pendingDeviceTokenRetry?: boolean;
|
|
103
|
+
trustedDeviceTokenRetry?: boolean;
|
|
104
|
+
preferBootstrapToken?: boolean;
|
|
105
|
+
nonce: string | null;
|
|
106
|
+
challengeTs?: number | null;
|
|
107
|
+
}): Promise<GatewayBrowserDeviceAuthPlan>;
|
|
108
|
+
acceptHello(hello: Pick<HelloOk, "auth">, plan: GatewayBrowserDeviceAuthPlan): Promise<void>;
|
|
109
|
+
clearStoredToken(plan: GatewayBrowserDeviceAuthPlan): Promise<void>;
|
|
110
|
+
}
|
|
111
|
+
//#endregion
|
|
112
|
+
export { GatewayBrowserDeviceTokenStore as a, resolveGatewayConnectScopes as c, GatewayBrowserDeviceTokenRecord as i, selectGatewayConnectAuth as l, GatewayBrowserDeviceAuthPlan as n, GatewayConnectAuthSelection as o, GatewayBrowserDeviceIdentity as r, buildGatewayConnectAuth as s, GatewayBrowserDeviceAuthLifecycle as t, shouldRetryGatewayWithDeviceToken as u };
|
package/dist/browser.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as
|
|
1
|
+
import { A as gatewayCredentialScope, C as reduceSessionProjection, D as normalizeSessionProjectionRunId, E as SessionMessageIdentity, M as buildDeviceAuthPayload, N as buildDeviceAuthPayloadV3, O as readSessionMessageIdentity, P as normalizeDeviceMetadataForAuth, S as reconcileSessionProjectionSnapshot, T as SessionMessageEnvelope, _ as SessionProjectionState, a as GatewaySessionMessageSubscriptionOptions, b as isLocallyOptimisticSessionMessage, c as resetGatewaySessionMessageSubscriptionCoordinator, d as SessionProjectionGatewayRunEvent, f as SessionProjectionRun, g as SessionProjectionSnapshotOptions, h as SessionProjectionScope, i as GatewaySessionMessageSubscriptionCoordinatorOptions, j as gatewayOriginScope, k as readSessionMessageSequence, l as SessionProjectionEntry, m as SessionProjectionRunTransition, n as GatewaySessionMessageSubscription, o as getGatewaySessionMessageSubscriptionCoordinator, p as SessionProjectionRunStatus, r as GatewaySessionMessageSubscriptionCoordinator, s as releaseGatewaySessionMessageSubscription, t as GatewaySessionMessageRequestClient, u as SessionProjectionEvent, v as createSessionProjection, w as reduceSessionProjectionRunEvent, x as projectLiveSessionMessage, y as hasSessionProjectionAcceptedFinal } from "./session-subscriptions-CKF7acYN.mjs";
|
|
2
|
+
import { a as GatewayBrowserDeviceTokenStore, c as resolveGatewayConnectScopes, i as GatewayBrowserDeviceTokenRecord, l as selectGatewayConnectAuth, n as GatewayBrowserDeviceAuthPlan, o as GatewayConnectAuthSelection, r as GatewayBrowserDeviceIdentity, s as buildGatewayConnectAuth, t as GatewayBrowserDeviceAuthLifecycle, u as shouldRetryGatewayWithDeviceToken } from "./browser-device-auth-Dz6H7eXy.mjs";
|
|
3
|
+
import { n as GatewayProtocolRequestOptions, r as GatewayProtocolRequestTimeoutError, t as GatewayProtocolRequestError } from "./protocol-request-D4mVhLxE.mjs";
|
|
4
|
+
import { a as GatewayProtocolTiming, i as GatewayProtocolSocketHandlers, n as GatewayProtocolCloseContext, o as GatewayProtocolRequestTiming, r as GatewayProtocolSocket, t as GatewayProtocolClient } from "./protocol-client-BbN-I582.mjs";
|
|
3
5
|
import { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, resolveSafeTimeoutDelayMs } from "./timeouts.mjs";
|
|
4
6
|
import { ConnectParams, ErrorShape, EventFrame, HelloOk } from "@openclaw/gateway-protocol";
|
|
5
7
|
export * from "@openclaw/gateway-protocol/connect-error-details";
|
|
@@ -17,4 +19,4 @@ declare function shouldPauseGatewayReconnect(params: {
|
|
|
17
19
|
clientVersionMismatchIsTerminal?: boolean;
|
|
18
20
|
}): boolean;
|
|
19
21
|
//#endregion
|
|
20
|
-
export { type ConnectParams, DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, type ErrorShape, type EventFrame, GatewayBrowserDeviceAuthLifecycle, GatewayBrowserDeviceAuthPlan, GatewayBrowserDeviceIdentity, GatewayBrowserDeviceTokenRecord, GatewayBrowserDeviceTokenStore, GatewayConnectAuthSelection, GatewayProtocolClient, GatewayProtocolCloseContext, GatewayProtocolRequestError, type GatewayProtocolRequestOptions, GatewayProtocolRequestTiming, GatewayProtocolSocket, GatewayProtocolSocketHandlers, GatewayProtocolTiming, GatewaySessionMessageRequestClient, GatewaySessionMessageSubscription, GatewaySessionMessageSubscriptionCoordinator, GatewaySessionMessageSubscriptionCoordinatorOptions, GatewaySessionMessageSubscriptionOptions, type HelloOk, SessionMessageEnvelope, SessionMessageIdentity, SessionProjectionEntry, SessionProjectionEvent, SessionProjectionGatewayRunEvent, SessionProjectionRun, SessionProjectionRunStatus, SessionProjectionRunTransition, SessionProjectionScope, SessionProjectionSnapshotOptions, SessionProjectionState, buildDeviceAuthPayload, buildDeviceAuthPayloadV3, buildGatewayConnectAuth, createSessionProjection, getGatewaySessionMessageSubscriptionCoordinator, hasSessionProjectionAcceptedFinal, isLocallyOptimisticSessionMessage, normalizeDeviceMetadataForAuth, normalizeSessionProjectionRunId, projectLiveSessionMessage, readSessionMessageIdentity, readSessionMessageSequence, reconcileSessionProjectionSnapshot, reduceSessionProjection, reduceSessionProjectionRunEvent, releaseGatewaySessionMessageSubscription, resetGatewaySessionMessageSubscriptionCoordinator, resolveGatewayConnectScopes, resolveSafeTimeoutDelayMs, selectGatewayConnectAuth, shouldPauseGatewayReconnect, shouldRetryGatewayWithDeviceToken };
|
|
22
|
+
export { type ConnectParams, DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, type ErrorShape, type EventFrame, GatewayBrowserDeviceAuthLifecycle, GatewayBrowserDeviceAuthPlan, GatewayBrowserDeviceIdentity, GatewayBrowserDeviceTokenRecord, GatewayBrowserDeviceTokenStore, GatewayConnectAuthSelection, GatewayProtocolClient, type GatewayProtocolCloseContext, GatewayProtocolRequestError, type GatewayProtocolRequestOptions, GatewayProtocolRequestTimeoutError, type GatewayProtocolRequestTiming, type GatewayProtocolSocket, type GatewayProtocolSocketHandlers, type GatewayProtocolTiming, GatewaySessionMessageRequestClient, GatewaySessionMessageSubscription, GatewaySessionMessageSubscriptionCoordinator, GatewaySessionMessageSubscriptionCoordinatorOptions, GatewaySessionMessageSubscriptionOptions, type HelloOk, type SessionMessageEnvelope, type SessionMessageIdentity, SessionProjectionEntry, SessionProjectionEvent, SessionProjectionGatewayRunEvent, SessionProjectionRun, SessionProjectionRunStatus, SessionProjectionRunTransition, SessionProjectionScope, SessionProjectionSnapshotOptions, SessionProjectionState, buildDeviceAuthPayload, buildDeviceAuthPayloadV3, buildGatewayConnectAuth, createSessionProjection, gatewayCredentialScope, gatewayOriginScope, getGatewaySessionMessageSubscriptionCoordinator, hasSessionProjectionAcceptedFinal, isLocallyOptimisticSessionMessage, normalizeDeviceMetadataForAuth, normalizeSessionProjectionRunId, projectLiveSessionMessage, readSessionMessageIdentity, readSessionMessageSequence, reconcileSessionProjectionSnapshot, reduceSessionProjection, reduceSessionProjectionRunEvent, releaseGatewaySessionMessageSubscription, resetGatewaySessionMessageSubscriptionCoordinator, resolveGatewayConnectScopes, resolveSafeTimeoutDelayMs, selectGatewayConnectAuth, shouldPauseGatewayReconnect, shouldRetryGatewayWithDeviceToken };
|
package/dist/browser.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as buildDeviceAuthPayload, S as
|
|
1
|
+
import { C as resolveGatewayConnectScopes, D as buildDeviceAuthPayloadV3, E as buildDeviceAuthPayload, O as normalizeDeviceMetadataForAuth, S as buildGatewayConnectAuth, T as shouldRetryGatewayWithDeviceToken, _ as GatewayProtocolRequestError, a as createSessionProjection, b as gatewayOriginScope, c as projectLiveSessionMessage, d as reduceSessionProjectionRunEvent, f as normalizeSessionProjectionRunId, g as GatewayProtocolClient, h as shouldPauseGatewayReconnect, i as resetGatewaySessionMessageSubscriptionCoordinator, l as reconcileSessionProjectionSnapshot, m as readSessionMessageSequence, n as getGatewaySessionMessageSubscriptionCoordinator, o as hasSessionProjectionAcceptedFinal, p as readSessionMessageIdentity, r as releaseGatewaySessionMessageSubscription, s as isLocallyOptimisticSessionMessage, t as GatewaySessionMessageSubscriptionCoordinator, u as reduceSessionProjection, v as GatewayProtocolRequestTimeoutError, w as selectGatewayConnectAuth, x as GatewayBrowserDeviceAuthLifecycle, y as gatewayCredentialScope } from "./session-subscriptions-OJnDJHPL.mjs";
|
|
2
2
|
import { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, resolveSafeTimeoutDelayMs } from "./timeouts.mjs";
|
|
3
3
|
export * from "@openclaw/gateway-protocol/connect-error-details";
|
|
4
4
|
export * from "@openclaw/gateway-protocol/client-info";
|
|
5
5
|
export * from "@openclaw/gateway-protocol/gateway-error-details";
|
|
6
6
|
export * from "@openclaw/gateway-protocol/startup-unavailable";
|
|
7
7
|
export * from "@openclaw/gateway-protocol/version";
|
|
8
|
-
export { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, GatewayBrowserDeviceAuthLifecycle, GatewayProtocolClient, GatewayProtocolRequestError, GatewaySessionMessageSubscriptionCoordinator, buildDeviceAuthPayload, buildDeviceAuthPayloadV3, buildGatewayConnectAuth, createSessionProjection, getGatewaySessionMessageSubscriptionCoordinator, hasSessionProjectionAcceptedFinal, isLocallyOptimisticSessionMessage, normalizeDeviceMetadataForAuth, normalizeSessionProjectionRunId, projectLiveSessionMessage, readSessionMessageIdentity, readSessionMessageSequence, reconcileSessionProjectionSnapshot, reduceSessionProjection, reduceSessionProjectionRunEvent, releaseGatewaySessionMessageSubscription, resetGatewaySessionMessageSubscriptionCoordinator, resolveGatewayConnectScopes, resolveSafeTimeoutDelayMs, selectGatewayConnectAuth, shouldPauseGatewayReconnect, shouldRetryGatewayWithDeviceToken };
|
|
8
|
+
export { DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, GatewayBrowserDeviceAuthLifecycle, GatewayProtocolClient, GatewayProtocolRequestError, GatewayProtocolRequestTimeoutError, GatewaySessionMessageSubscriptionCoordinator, buildDeviceAuthPayload, buildDeviceAuthPayloadV3, buildGatewayConnectAuth, createSessionProjection, gatewayCredentialScope, gatewayOriginScope, getGatewaySessionMessageSubscriptionCoordinator, hasSessionProjectionAcceptedFinal, isLocallyOptimisticSessionMessage, normalizeDeviceMetadataForAuth, normalizeSessionProjectionRunId, projectLiveSessionMessage, readSessionMessageIdentity, readSessionMessageSequence, reconcileSessionProjectionSnapshot, reduceSessionProjection, reduceSessionProjectionRunEvent, releaseGatewaySessionMessageSubscription, resetGatewaySessionMessageSubscriptionCoordinator, resolveGatewayConnectScopes, resolveSafeTimeoutDelayMs, selectGatewayConnectAuth, shouldPauseGatewayReconnect, shouldRetryGatewayWithDeviceToken };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as gatewayCredentialScope, C as reduceSessionProjection, D as normalizeSessionProjectionRunId, E as SessionMessageIdentity, M as buildDeviceAuthPayload, N as buildDeviceAuthPayloadV3, O as readSessionMessageIdentity, P as normalizeDeviceMetadataForAuth, S as reconcileSessionProjectionSnapshot, T as SessionMessageEnvelope, _ as SessionProjectionState, a as GatewaySessionMessageSubscriptionOptions, b as isLocallyOptimisticSessionMessage, c as resetGatewaySessionMessageSubscriptionCoordinator, d as SessionProjectionGatewayRunEvent, f as SessionProjectionRun, g as SessionProjectionSnapshotOptions, h as SessionProjectionScope, i as GatewaySessionMessageSubscriptionCoordinatorOptions, j as gatewayOriginScope, k as readSessionMessageSequence, l as SessionProjectionEntry, m as SessionProjectionRunTransition, n as GatewaySessionMessageSubscription, o as getGatewaySessionMessageSubscriptionCoordinator, p as SessionProjectionRunStatus, r as GatewaySessionMessageSubscriptionCoordinator, s as releaseGatewaySessionMessageSubscription, t as GatewaySessionMessageRequestClient, u as SessionProjectionEvent, v as createSessionProjection, w as reduceSessionProjectionRunEvent, x as projectLiveSessionMessage, y as hasSessionProjectionAcceptedFinal } from "./session-subscriptions-CKF7acYN.mjs";
|
|
2
|
+
import { a as GatewayBrowserDeviceTokenStore, c as resolveGatewayConnectScopes, i as GatewayBrowserDeviceTokenRecord, l as selectGatewayConnectAuth, n as GatewayBrowserDeviceAuthPlan, o as GatewayConnectAuthSelection, r as GatewayBrowserDeviceIdentity, s as buildGatewayConnectAuth, t as GatewayBrowserDeviceAuthLifecycle, u as shouldRetryGatewayWithDeviceToken } from "./browser-device-auth-Dz6H7eXy.mjs";
|
|
2
3
|
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
|
-
import { _ as
|
|
4
|
-
|
|
4
|
+
import { _ as GatewayClientRequestTimeoutError, a as startGatewayClientWithReadinessWait, b as GatewayClientRequestError, c as waitForEventLoopReady, d as GatewayClient, f as GatewayClientCloseInfo, g as GatewayClientRequestOptions, h as GatewayClientOptions, i as startGatewayClientWhenEventLoopReady, l as DeviceAuthTokenRecord, m as GatewayClientHostDeps, n as GatewayClientStartReadinessOptions, o as EventLoopReadyOptions, p as GatewayClientConnectionMetadata, r as GatewayClientStartable, s as EventLoopReadyResult, t as EventLoopReadyWaiter, u as DeviceIdentity, v as GatewayReconnectPausedInfo, y as isGatewayConnectAssemblyError } from "./readiness-JllUDKLg.mjs";
|
|
5
|
+
import { GatewayScopeUpgrade, ScopeUpgradeBinding, ScopeUpgradeOptions, ScopeUpgradeOutcome } from "./scope-upgrade.mjs";
|
|
6
|
+
|
|
7
|
+
//#region packages/gateway-client/src/cloudflare-access.d.ts
|
|
8
|
+
declare const CF_ACCESS_CLIENT_ID_HEADER = "CF-Access-Client-Id";
|
|
9
|
+
declare const CF_ACCESS_CLIENT_SECRET_HEADER = "CF-Access-Client-Secret";
|
|
10
|
+
type CloudflareAccessCredentials = Readonly<{
|
|
11
|
+
clientId: string;
|
|
12
|
+
clientSecret: string;
|
|
13
|
+
}>;
|
|
14
|
+
/** Build only the two headers Cloudflare Access defines for service-token auth. */
|
|
15
|
+
declare function buildCloudflareAccessHeaders(credentials: CloudflareAccessCredentials): Record<string, string>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { CF_ACCESS_CLIENT_ID_HEADER, CF_ACCESS_CLIENT_SECRET_HEADER, CloudflareAccessCredentials, DEFAULT_GATEWAY_REQUEST_TIMEOUT_MS, DEFAULT_PREAUTH_HANDSHAKE_TIMEOUT_MS, DeviceAuthTokenRecord, DeviceIdentity, EventLoopReadyOptions, EventLoopReadyResult, EventLoopReadyWaiter, GatewayBrowserDeviceAuthLifecycle, GatewayBrowserDeviceAuthPlan, GatewayBrowserDeviceIdentity, GatewayBrowserDeviceTokenRecord, GatewayBrowserDeviceTokenStore, GatewayClient, GatewayClientCloseInfo, GatewayClientConnectionMetadata, GatewayClientHostDeps, GatewayClientOptions, GatewayClientRequestError, GatewayClientRequestOptions, GatewayClientRequestTimeoutError, GatewayClientStartReadinessOptions, GatewayClientStartable, GatewayConnectAuthSelection, GatewayReconnectPausedInfo, GatewayScopeUpgrade, GatewaySessionMessageRequestClient, GatewaySessionMessageSubscription, GatewaySessionMessageSubscriptionCoordinator, GatewaySessionMessageSubscriptionCoordinatorOptions, GatewaySessionMessageSubscriptionOptions, MAX_CONNECT_CHALLENGE_TIMEOUT_MS, MAX_SAFE_TIMEOUT_DELAY_MS, MIN_CONNECT_CHALLENGE_TIMEOUT_MS, ScopeUpgradeBinding, ScopeUpgradeOptions, ScopeUpgradeOutcome, type SessionMessageEnvelope, type SessionMessageIdentity, SessionProjectionEntry, SessionProjectionEvent, SessionProjectionGatewayRunEvent, SessionProjectionRun, SessionProjectionRunStatus, SessionProjectionRunTransition, SessionProjectionScope, SessionProjectionSnapshotOptions, SessionProjectionState, addSafeTimeoutDelayGraceMs, buildCloudflareAccessHeaders, buildDeviceAuthPayload, buildDeviceAuthPayloadV3, buildGatewayConnectAuth, clampConnectChallengeTimeoutMs, clearGatewayConnectTimeout, createSessionProjection, gatewayCredentialScope, gatewayOriginScope, getConnectChallengeTimeoutMsFromEnv, getGatewaySessionMessageSubscriptionCoordinator, hasSessionProjectionAcceptedFinal, isGatewayConnectAssemblyError, isLocallyOptimisticSessionMessage, normalizeDeviceMetadataForAuth, normalizeSessionProjectionRunId, projectLiveSessionMessage, readSessionMessageIdentity, readSessionMessageSequence, reconcileSessionProjectionSnapshot, reduceSessionProjection, reduceSessionProjectionRunEvent, releaseGatewaySessionMessageSubscription, resetGatewaySessionMessageSubscriptionCoordinator, resolveConnectChallengeTimeoutMs, resolveFiniteTimeoutDelayMs, resolveGatewayConnectScopes, resolvePreauthHandshakeTimeoutMs, resolveSafeTimeoutDelayMs, selectGatewayConnectAuth, shouldRetryGatewayWithDeviceToken, startGatewayClientWhenEventLoopReady, startGatewayClientWithReadinessWait, startGatewayConnectTimeout, waitForEventLoopReady };
|