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

Function deps

packages/opencode/test/plugin/install.test.ts:9–32  ·  view source on GitHub ↗
(global: string, target: string | Error)

Source from the content-addressed store, hash-verified

7import { tmpdir } from "../fixture/fixture"
8
9function deps(global: string, target: string | Error): PlugDeps {
10 return {
11 spinner: () => ({
12 start() {},
13 stop() {},
14 }),
15 log: {
16 error() {},
17 info() {},
18 success() {},
19 },
20 resolve: async () => {
21 if (target instanceof Error) throw target
22 return target
23 },
24 readText: (file) => Filesystem.readText(file),
25 write: async (file, text) => {
26 await Filesystem.write(file, text)
27 },
28 exists: (file) => Filesystem.exists(file),
29 files: (dir, name) => [path.join(dir, `${name}.jsonc`), path.join(dir, `${name}.json`)],
30 global,
31 }
32}
33
34function ctx(dir: string): PlugCtx {
35 return {

Callers 1

install.test.tsFile · 0.70

Calls 2

writeMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected