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

Function get

packages/app/src/context/file.tsx:230–241  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

228 })
229
230 const get = (input: string) => {
231 const file = path.normalize(input)
232 const state = store.file[file]
233 const content = state?.content
234 if (!content) return state
235 if (hasFileContent(file)) {
236 touchFileContent(file)
237 return state
238 }
239 touchFileContent(file, approxBytes(content))
240 return state
241 }
242
243 function withPath(input: string, action: (file: string) => unknown) {
244 return action(path.normalize(input))

Callers 1

useDefaultServerKeyFunction · 0.50

Calls 3

hasFileContentFunction · 0.90
touchFileContentFunction · 0.90
approxBytesFunction · 0.90

Tested by

no test coverage detected