MCPcopy Create free account
hub / github.com/CopilotKit/aimock / encodeEventStreamMessage

Function encodeEventStreamMessage

src/aws-event-stream.ts:100–108  ·  view source on GitHub ↗
(eventType: string, jsonPayload: object)

Source from the content-addressed store, hash-verified

98 * `:message-type` = `event`.
99 */
100export function encodeEventStreamMessage(eventType: string, jsonPayload: object): Buffer {
101 const headers: Record<string, string> = {
102 ":content-type": "application/json",
103 ":event-type": eventType,
104 ":message-type": "event",
105 };
106 const payload = Buffer.from(JSON.stringify(jsonPayload), "utf8");
107 return encodeEventStreamFrame(headers, payload);
108}
109
110/**
111 * Write a sequence of event-stream frames to an HTTP response with optional

Callers 13

writeEventStreamFunction · 0.85
cTextFunction · 0.85
cToolStartFunction · 0.85
cToolArgFunction · 0.85
nTextFunction · 0.85
nToolStartFunction · 0.85
nToolArgFunction · 0.85

Calls 1

encodeEventStreamFrameFunction · 0.85

Tested by 6

cTextFunction · 0.68
cToolStartFunction · 0.68
cToolArgFunction · 0.68
nTextFunction · 0.68
nToolStartFunction · 0.68
nToolArgFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…