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

Function withFiles

packages/opencode/test/session/instruction.test.ts:60–66  ·  view source on GitHub ↗
(files: Record<string, string>, self: (dir: string) => Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

58 )
59
60const withFiles = <A, E, R>(files: Record<string, string>, self: (dir: string) => Effect.Effect<A, E, R>) =>
61 provideTmpdirInstance((dir) =>
62 Effect.gen(function* () {
63 yield* writeFiles(dir, files)
64 return yield* self(dir).pipe(provideInstruction({ home: dir, config: dir }))
65 }),
66 )
67
68const tmpWithFiles = (files: Record<string, string>) =>
69 Effect.gen(function* () {

Callers 1

Calls 3

provideTmpdirInstanceFunction · 0.90
writeFilesFunction · 0.85
provideInstructionFunction · 0.85

Tested by

no test coverage detected