MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / write

Function write

packages/agent-core/src/utils/per-id-json-store.ts:98–102  ·  view source on GitHub ↗
(id: string, value: T)

Source from the content-addressed store, hash-verified

96 }
97
98 async function write(id: string, value: T): Promise<void> {
99 const target = fileFor(id);
100 await mkdir(dir, { recursive: true, mode: 0o700 });
101 await atomicWrite(target, JSON.stringify(value, null, 2));
102 }
103
104 async function read(id: string): Promise<T | undefined> {
105 const path = fileFor(id);

Callers

nothing calls this directly

Calls 3

atomicWriteFunction · 0.90
fileForFunction · 0.85
mkdirFunction · 0.50

Tested by

no test coverage detected