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

Function write

packages/opencode/src/storage/storage.ts:296–299  ·  view source on GitHub ↗
(key: string[], content: unknown)

Source from the content-addressed store, hash-verified

294 })
295
296 const write: Interface["write"] = (key: string[], content: unknown) =>
297 Effect.gen(function* () {
298 yield* withResolved(key, (target, rw) => TxReentrantLock.withWriteLock(rw, writeJson(target, content)))
299 })
300
301 const list: Interface["list"] = Effect.fn("Storage.list")(function* (prefix: string[]) {
302 const dir = (yield* state).dir

Callers 4

closeSocketFunction · 0.50
closeAcceptedFunction · 0.50
pty.tsFile · 0.50
control.tsFile · 0.50

Calls 2

withResolvedFunction · 0.85
writeJsonFunction · 0.85

Tested by

no test coverage detected