MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / readWorkspaceFile

Function readWorkspaceFile

src/workspaces/file-service.ts:104–115  ·  view source on GitHub ↗
(
  workspaceDir: string,
  relPath: string,
)

Source from the content-addressed store, hash-verified

102 * within the same traversal guard).
103 */
104export async function readWorkspaceFile(
105 workspaceDir: string,
106 relPath: string,
107): Promise<string | null> {
108 const abs = resolveInside(workspaceDir, relPath);
109 try {
110 return await nodeReadFile(abs, 'utf8');
111 } catch (err) {
112 if (isENOENT(err)) return null;
113 throw err;
114 }
115}
116
117/**
118 * Atomically write a UTF-8 text file at `<workspaceDir>/<relPath>`.

Callers 10

readWorkspaceMetadataFunction · 0.70
readAiConfigFunction · 0.50
readAiConfigFunction · 0.50
readAiConfigFunction · 0.50
readAiConfigFunction · 0.50
updateIssueFieldsFunction · 0.50
appendIssueCommentFunction · 0.50
createIssueFunction · 0.50
readSelfIssueFunction · 0.50
createWorkspaceRoutesFunction · 0.50

Calls 2

resolveInsideFunction · 0.85
isENOENTFunction · 0.70

Tested by

no test coverage detected