MCPcopy Create free account
hub / github.com/anomalyco/opencode / textEvent

Function textEvent

packages/http-recorder/src/websocket.ts:42–46  ·  view source on GitHub ↗
(direction: "client" | "server", body: string)

Source from the content-addressed store, hash-verified

40 )
41
42const textEvent = (direction: "client" | "server", body: string): WebSocketEvent => ({
43 direction,
44 kind: "text",
45 body,
46})
47
48const decodeEvent = (event: WebSocketEvent) =>
49 event.kind === "text" ? event.body : new Uint8Array(Buffer.from(event.body, "base64"))

Callers 1

makeWebSocketExecutorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected