MCPcopy Create free account
hub / github.com/anomalyco/opencode / makeCtx

Function makeCtx

packages/opencode/test/tool/apply_patch.test.ts:62–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60})
61
62const makeCtx = () => {
63 const calls: AskInput[] = []
64 const ctx: ToolCtx = {
65 ...baseCtx,
66 ask: (input) =>
67 Effect.sync(() => {
68 calls.push(input)
69 }),
70 }
71
72 return { ctx, calls }
73}
74
75const readText = (filepath: string) => Effect.promise(() => fs.readFile(filepath, "utf-8"))
76const writeText = (filepath: string, content: string) => Effect.promise(() => fs.writeFile(filepath, content, "utf-8"))

Callers 1

Calls 2

syncMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected