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

Function execute

packages/client/src/generated/client.ts:163–170  ·  view source on GitHub ↗
(descriptor: RequestDescriptor, requestOptions?: RequestOptions)

Source from the content-addressed store, hash-verified

161 }
162
163 const execute = async (descriptor: RequestDescriptor, requestOptions?: RequestOptions) => {
164 try {
165 const prepared = prepare(descriptor, requestOptions)
166 return await fetch(prepared.url, prepared.init)
167 } catch (cause) {
168 throw new ClientError("Transport", { cause })
169 }
170 }
171
172 const responseError = async (response: Response, descriptor: RequestDescriptor): Promise<never> => {
173 if (descriptor.declaredStatuses.includes(response.status)) throw await json(response)

Callers 2

requestFunction · 0.70
[Symbol.asyncIterator]Function · 0.70

Calls 2

prepareFunction · 0.70
fetchFunction · 0.50

Tested by

no test coverage detected