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

Function writeSessionState

packages/node-sdk/test/rename-session.test.ts:27–32  ·  view source on GitHub ↗
(
  sessionDir: string,
  state: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

25}
26
27async function writeSessionState(
28 sessionDir: string,
29 state: Record<string, unknown>,
30): Promise<void> {
31 await writeFile(join(sessionDir, 'state.json'), `${JSON.stringify(state, null, 2)}\n`, 'utf-8');
32}
33
34async function readSessionState(sessionDir: string): Promise<Record<string, unknown>> {
35 const raw = await readFile(join(sessionDir, 'state.json'), 'utf-8');

Callers 1

Calls 1

writeFileFunction · 0.50

Tested by

no test coverage detected