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

Function request

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

Source from the content-addressed store, hash-verified

9const context = Context.empty() as Context.Context<unknown>
10
11function request(route: string, directory: string, init: RequestInit = {}) {
12 const headers = new Headers(init.headers)
13 headers.set("x-opencode-directory", directory)
14 return HttpApiApp.webHandler().handler(
15 new Request(`http://localhost${route}`, {
16 ...init,
17 headers,
18 }),
19 context,
20 )
21}
22
23const Event = Schema.Struct({
24 id: EventV2.ID,

Callers 1

Calls 1

setMethod · 0.45

Tested by

no test coverage detected