MCPcopy
hub / github.com/coder/mux / readContentFile

Function readContentFile

src/node/services/additionalSystemContext.ts:39–48  ·  view source on GitHub ↗
(config: SessionDirProvider, workspaceId: string)

Source from the content-addressed store, hash-verified

37}
38
39async function readContentFile(config: SessionDirProvider, workspaceId: string): Promise<string> {
40 try {
41 return await fs.readFile(getAdditionalSystemContextPath(config, workspaceId), "utf-8");
42 } catch (error) {
43 if (isErrnoWithCode(error, "ENOENT")) {
44 return "";
45 }
46 throw error;
47 }
48}
49
50async function readEnabledFlag(config: SessionDirProvider, workspaceId: string): Promise<boolean> {
51 // Default to enabled when the marker file is absent.

Callers 1

Calls 3

isErrnoWithCodeFunction · 0.90
readFileMethod · 0.65

Tested by

no test coverage detected