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

Function readEnvelopeText

src/video-proxy-shared.ts:186–197  ·  view source on GitHub ↗
(
  res: Response,
  record: RecordConfig | undefined,
)

Source from the content-addressed store, hash-verified

184 * fallback) without retaining anything oversized in memory.
185 */
186export async function readEnvelopeText(
187 res: Response,
188 record: RecordConfig | undefined,
189): Promise<string> {
190 const read = await readBodyIdle(res, record, VIDEO_PROXY_ENVELOPE_BODY_CAP);
191 if (read.overCap) {
192 throw new Error(
193 `Upstream envelope body exceeded ${VIDEO_PROXY_ENVELOPE_BODY_CAP} bytes (read aborted at ${read.bytesRead})`,
194 );
195 }
196 return read.buf.toString("utf8");
197}

Callers 7

proxyVeoVideoSubmitFunction · 0.85
proxyVeoVideoRecordPollFunction · 0.85
proxyGrokVideoSubmitFunction · 0.85
proxyGrokVideoRecordPollFunction · 0.85

Calls 1

readBodyIdleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…