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

Function read

packages/opencode/src/storage/storage.ts:272–278  ·  view source on GitHub ↗
(key: string[])

Source from the content-addressed store, hash-verified

270 })
271
272 const read: Interface["read"] = <T>(key: string[]) =>
273 Effect.gen(function* () {
274 const value = yield* withResolved(key, (target, rw) =>
275 TxReentrantLock.withReadLock(rw, wrap(target, fs.readJson(target))),
276 )
277 return value as T
278 })
279
280 const update: Interface["update"] = <T>(key: string[], fn: (draft: T) => void) =>
281 Effect.gen(function* () {

Callers

nothing calls this directly

Calls 2

withResolvedFunction · 0.85
wrapFunction · 0.70

Tested by

no test coverage detected