mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-23 15:01:16 +00:00
* fix(ci): verify script declaration contracts * fix(ci): harden declaration export analysis * fix(ci): cover opaque script module exports * test(ci): cover cyclic script declaration barrels
45 lines
1.5 KiB
TypeScript
45 lines
1.5 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 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>;
|