MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / appendTraces

Function appendTraces

e2e/src/trace-harvest.ts:28–36  ·  view source on GitHub ↗
(runDir: string, entries: ReadonlyArray<TraceEntry>)

Source from the content-addressed store, hash-verified

26const fileFor = (runDir: string) => join(runDir, "traces.json");
27
28export const appendTraces = (runDir: string, entries: ReadonlyArray<TraceEntry>): void => {
29 if (entries.length === 0) return;
30 const file = fileFor(runDir);
31 const existing: TraceEntry[] = existsSync(file)
32 ? (JSON.parse(readFileSync(file, "utf8")) as TraceEntry[])
33 : [];
34 const merged = [...existing, ...entries].sort((a, b) => a.at - b.at);
35 writeFileSync(file, JSON.stringify(merged, null, 1));
36};

Callers 2

finishFunction · 0.90
makeBrowserSurfaceFunction · 0.90

Calls 1

fileForFunction · 0.70

Tested by

no test coverage detected