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

Method writeFile

src/node/services/sessionUsageService.ts:135–139  ·  view source on GitHub ↗
(workspaceId: string, data: SessionUsageFile)

Source from the content-addressed store, hash-verified

133 }
134
135 private async writeFile(workspaceId: string, data: SessionUsageFile): Promise<void> {
136 const filePath = this.getFilePath(workspaceId);
137 await fs.mkdir(path.dirname(filePath), { recursive: true });
138 await writeFileAtomic(filePath, JSON.stringify(data, null, 2));
139 }
140
141 /**
142 * Record usage from a completed stream. Accumulates with existing usage

Callers 5

recordUsageMethod · 0.95
setTokenStatsCacheMethod · 0.95
rollUpUsageIntoParentMethod · 0.95
resetSessionUsageMethod · 0.95

Calls 1

getFilePathMethod · 0.95

Tested by

no test coverage detected