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

Function readWireMtime

packages/migration-legacy/src/detect.ts:116–132  ·  view source on GitHub ↗
(sessionDir: string)

Source from the content-addressed store, hash-verified

114}
115
116async function readWireMtime(sessionDir: string): Promise<number> {
117 try {
118 const text = await readFile(join(sessionDir, 'state.json'), 'utf-8');
119 const parsed = OldSessionStateSchema.parse(JSON.parse(text));
120 if (parsed.wire_mtime !== null && parsed.wire_mtime !== undefined) {
121 return parsed.wire_mtime * 1000;
122 }
123 } catch {
124 // fall through to wire.jsonl mtime
125 }
126 try {
127 const st = await stat(join(sessionDir, 'wire.jsonl'));
128 return st.mtimeMs;
129 } catch {
130 return 0;
131 }
132}

Callers 1

detectMigrationFunction · 0.70

Calls 2

readFileFunction · 0.50
statFunction · 0.50

Tested by

no test coverage detected