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

Function withTmpdirInstance

packages/opencode/test/fixture/fixture.ts:202–211  ·  view source on GitHub ↗
(options?: {
    git?: boolean
    config?: Partial<ConfigV1.Info> | (() => Partial<ConfigV1.Info>)
    init?: (directory: string) => Effect.Effect<void, E2, R2>
  })

Source from the content-addressed store, hash-verified

200
201export const withTmpdirInstance =
202 <E2 = never, R2 = never>(options?: {
203 git?: boolean
204 config?: Partial<ConfigV1.Info> | (() => Partial<ConfigV1.Info>)
205 init?: (directory: string) => Effect.Effect<void, E2, R2>
206 }) =>
207 <A, E, R>(self: Effect.Effect<A, E, R>) =>
208 Effect.gen(function* () {
209 const directory = yield* tmpdirScoped(options)
210 return yield* self.pipe(Effect.provideService(TestInstance, { directory }), provideInstanceEffect(directory))
211 }).pipe(Effect.provide(testInstanceStoreLayer), Effect.provide(AppNodeBuilder.build(CrossSpawnSpawner.node)))
212
213export function provideTmpdirServer<A, E, R>(
214 self: (input: { dir: string; llm: TestLLMServer["Service"] }) => Effect.Effect<A, E, R>,

Callers 2

instanceFunction · 0.90
makeFunction · 0.90

Calls 2

tmpdirScopedFunction · 0.85
provideInstanceEffectFunction · 0.85

Tested by

no test coverage detected