MCPcopy Index your code
hub / github.com/anomalyco/opencode / capture

Function capture

packages/opencode/test/server/httpapi-exercise/backend.ts:117–126  ·  view source on GitHub ↗
(response: Response, mode: CaptureMode)

Source from the content-addressed store, hash-verified

115}
116
117async function capture(response: Response, mode: CaptureMode): Promise<CallResult> {
118 const text = mode === "stream" ? await captureStream(response) : await response.text()
119 return {
120 status: response.status,
121 contentType: response.headers.get("content-type") ?? "",
122 text,
123 body: parse(text),
124 timedOut: false,
125 }
126}
127
128async function captureStream(response: Response) {
129 if (!response.body) return ""

Callers 2

callFunction · 0.70
callAuthProbeFunction · 0.70

Calls 4

parseFunction · 0.90
captureStreamFunction · 0.85
textMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected