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

Function collectBody

packages/core/src/tool/webfetch.ts:92–97  ·  view source on GitHub ↗
(response: HttpClientResponse.HttpClientResponse)

Source from the content-addressed store, hash-verified

90 http.execute(request(url, format, userAgent)).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk))
91
92const collectBody = (response: HttpClientResponse.HttpClientResponse) =>
93 collectBoundedResponseBody(
94 response,
95 MAX_RESPONSE_BYTES,
96 () => new Error(`Response too large (exceeds ${MAX_RESPONSE_BYTES} byte limit)`),
97 )
98
99const mimeFrom = (contentType: string) => contentType.split(";", 1)[0]?.trim().toLowerCase() ?? ""
100const isImageAttachment = (mime: string) =>

Callers 1

webfetch.tsFile · 0.85

Calls 1

Tested by

no test coverage detected