MCPcopy
hub / github.com/anomalyco/opencode / fn

Function fn

packages/opencode/src/cli/cmd/tui.ts:25–38  ·  view source on GitHub ↗
(input: RequestInfo | URL, init?: RequestInit)

Source from the content-addressed store, hash-verified

23
24function createWorkerFetch(client: RpcClient): typeof fetch {
25 const fn = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
26 const request = new Request(input, init)
27 const body = request.body ? await request.text() : undefined
28 const result = await client.call("fetch", {
29 url: request.url,
30 method: request.method,
31 headers: Object.fromEntries(request.headers.entries()),
32 body,
33 })
34 return new Response(result.body, {
35 status: result.status,
36 headers: result.headers,
37 })
38 }
39 return fn as typeof fetch
40}
41

Callers 15

withRetryFunction · 0.70
emitFunction · 0.50
withCliFixtureFunction · 0.50
onCloseFunction · 0.50
closeFunction · 0.50
submitFunction · 0.50
removeQueuedFunction · 0.50
appendFunction · 0.50
notifyFunction · 0.50
onCloseFunction · 0.50
withGlobalConfigFunction · 0.50
withFetchFunction · 0.50

Calls 1

textMethod · 0.65

Tested by 11

onCloseFunction · 0.40
closeFunction · 0.40
submitFunction · 0.40
removeQueuedFunction · 0.40
appendFunction · 0.40
notifyFunction · 0.40
onCloseFunction · 0.40
withGlobalConfigFunction · 0.40
withFetchFunction · 0.40
eachFunction · 0.40
withTrackedSnapshotFunction · 0.40