MCPcopy Create free account
hub / github.com/ephraimduncan/opencode-cursor / parseConnectEndStream

Function parseConnectEndStream

src/proxy.ts:717–730  ·  view source on GitHub ↗
(data: Uint8Array)

Source from the content-addressed store, hash-verified

715}
716
717function parseConnectEndStream(data: Uint8Array): Error | null {
718 try {
719 const payload = JSON.parse(new TextDecoder().decode(data));
720 const error = payload?.error;
721 if (error) {
722 const code = error.code ?? "unknown";
723 const message = error.message ?? "Unknown error";
724 return new Error(`Connect error ${code}: ${message}`);
725 }
726 return null;
727 } catch {
728 return new Error("Failed to parse Connect end stream");
729 }
730}
731
732function makeHeartbeatBytes(): Uint8Array {
733 const heartbeat = create(AgentClientMessageSchema, {

Callers 1

startFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected