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

Function deps

packages/opencode/test/fixture/plug-worker.ts:39–62  ·  view source on GitHub ↗
(msg: Msg)

Source from the content-addressed store, hash-verified

37}
38
39function deps(msg: Msg): PlugDeps {
40 return {
41 spinner: () => ({
42 start() {},
43 stop() {},
44 }),
45 log: {
46 error() {},
47 info() {},
48 success() {},
49 },
50 resolve: async () => msg.target,
51 readText: (file) => Filesystem.readText(file),
52 write: async (file, text) => {
53 if (msg.holdMs && msg.holdMs > 0) {
54 await sleep(msg.holdMs)
55 }
56 await Filesystem.write(file, text)
57 },
58 exists: (file) => Filesystem.exists(file),
59 files: (dir, name) => [path.join(dir, `${name}.jsonc`), path.join(dir, `${name}.json`)],
60 global: msg.globalDir ?? path.join(msg.dir, ".global"),
61 }
62}
63
64function ctx(msg: Msg): PlugCtx {
65 return {

Callers 1

mainFunction · 0.70

Calls 3

writeMethod · 0.80
sleepFunction · 0.70
existsMethod · 0.45

Tested by

no test coverage detected