mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-24 15:41:13 +00:00
fix(docker): keep gateway ws client self-contained (#107561)
* fix(docker): keep gateway ws client self-contained * test(raft): narrow optional runtime schema * test(tlon): narrow signed URL mock input * fix(tui): type searchable selector metadata
This commit is contained in:
committed by
GitHub
parent
3b9c0efadd
commit
242cdca058
@@ -1,7 +1,16 @@
|
||||
// Gateway Ws Client script supports OpenClaw repository automation.
|
||||
import { Buffer } from "node:buffer";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import WebSocket from "ws";
|
||||
import { rawDataToString } from "../../src/infra/ws.js";
|
||||
|
||||
// Release Docker images ship this script without src/, so keep transport
|
||||
// normalization self-contained instead of importing a core-only helper.
|
||||
export function rawDataToString(data: WebSocket.RawData): string {
|
||||
if (Array.isArray(data)) {
|
||||
return Buffer.concat(data).toString("utf8");
|
||||
}
|
||||
return data instanceof ArrayBuffer ? Buffer.from(data).toString("utf8") : data.toString("utf8");
|
||||
}
|
||||
|
||||
type GatewayReqFrame = { type: "req"; id: string; method: string; params?: unknown };
|
||||
type GatewayResFrame = {
|
||||
|
||||
Reference in New Issue
Block a user