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

Function request

packages/opencode/test/server/httpapi-v2-pty.test.ts:20–30  ·  view source on GitHub ↗
(route: string, directory: string, init: RequestInit = {})

Source from the content-addressed store, hash-verified

18const testPty = process.platform === "win32" ? test.skip : test
19
20function request(route: string, directory: string, init: RequestInit = {}) {
21 const headers = new Headers(init.headers)
22 headers.set("x-opencode-directory", directory)
23 return HttpApiApp.webHandler().handler(
24 new Request(`http://localhost${route}`, {
25 ...init,
26 headers,
27 }),
28 context,
29 )
30}
31
32const testStateLayer = Layer.effectDiscard(
33 Effect.gen(function* () {

Callers 1

Calls 1

setMethod · 0.45

Tested by

no test coverage detected