MCPcopy Index your code
hub / github.com/coder/mux / readFilePrefix

Method readFilePrefix

src/node/services/memoryService.ts:261–261  ·  view source on GitHub ↗

* Read at most `maxBytes` from the head of the file. Index/hot-set builds * use this so files edited outside MemoryService cannot force unbounded reads * on stream startup. May split a trailing multibyte code point; callers treat * the result as a best-effort prefix.

(relPath: string, maxBytes: number)

Source from the content-addressed store, hash-verified

259 * the result as a best-effort prefix.
260 */
261 readFilePrefix(relPath: string, maxBytes: number): Promise<string>;
262 /** Atomic write; creates parent directories. */
263 writeFile(relPath: string, content: string): Promise<void>;
264 /** Recursive delete of a file or directory. */

Callers 3

readBoundedTextFileMethod · 0.65
listIndexEntriesMethod · 0.65
listHotMemoriesMethod · 0.65

Implementers 1

LocalMemoryStoresrc/node/services/memoryService.ts

Calls

no outgoing calls

Tested by

no test coverage detected