mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 10:51:15 +00:00
* fix(e2e): bound gateway network HTTP probes * test(e2e): align timeout proof with repo guards * test(e2e): use a typed stalled response
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
export type GatewayFrame = {
|
|
error?: {
|
|
code?: string;
|
|
details?: Record<string, unknown>;
|
|
message?: string;
|
|
retryable?: boolean;
|
|
};
|
|
id?: string;
|
|
ok?: boolean;
|
|
payload?: Record<string, unknown>;
|
|
type?: string;
|
|
};
|
|
export type GatewaySocket = { close(): void; send(payload: string): void };
|
|
export function assertReadySuspensionResponse(
|
|
response: Record<string, unknown>,
|
|
now?: number,
|
|
): Record<string, unknown>;
|
|
export function assertGatewaySuspendingError(response: GatewayFrame): void;
|
|
export function assertSuspendedProbes(
|
|
health: Record<string, unknown>,
|
|
readiness: Record<string, unknown>,
|
|
): void;
|
|
export function runGatewaySuspensionPreRestartClient(
|
|
options: { statePath: string; token: string; url: string; timeoutMs?: number },
|
|
deps?: { fetchImpl?: typeof fetch },
|
|
): Promise<void>;
|
|
export function runGatewaySuspensionPostRestartClient(
|
|
options: { statePath: string; token: string; url: string; timeoutMs?: number },
|
|
deps?: { fetchImpl?: typeof fetch },
|
|
): Promise<void>;
|
|
export function responseError(method: string, response: GatewayFrame): Error;
|
|
export function runGatewayNetworkClient(
|
|
options: { token: string; url: string; timeoutMs?: number },
|
|
deps?: {
|
|
delay?: (ms: number) => Promise<void>;
|
|
onceFrame?: (
|
|
ws: GatewaySocket,
|
|
predicate: (message: GatewayFrame) => boolean,
|
|
timeoutMs?: number,
|
|
) => Promise<GatewayFrame>;
|
|
openSocket?: (url: string, timeoutMs?: number) => Promise<GatewaySocket>;
|
|
protocolVersion?: number;
|
|
stdout?: (message: string) => void;
|
|
},
|
|
): Promise<void>;
|