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

Method stat

packages/agent-core/src/services/fs/fsService.ts:269–283  ·  view source on GitHub ↗
(sessionId: string, req: FsStatRequest)

Source from the content-addressed store, hash-verified

267 }
268
269 async stat(sessionId: string, req: FsStatRequest): Promise<FsEntry> {
270 const session = await this.sessions.get(sessionId);
271 const cwd = session.metadata.cwd;
272 const safe = await resolveSafePath(cwd, req.path);
273 let st: import('node:fs').Stats;
274 try {
275 st = await fs.stat(safe.absolute);
276 } catch (err) {
277 throw mapStatError(err, req.path);
278 }
279 const name =
280 safe.relative === '.' ? path.basename(cwd) : path.basename(safe.absolute);
281
282 return buildFsEntryFromStat(safe.relative, name, safe.absolute, st, true);
283 }
284
285 async statMany(
286 sessionId: string,

Callers

nothing calls this directly

Calls 5

resolveSafePathFunction · 0.90
mapStatErrorFunction · 0.85
buildFsEntryFromStatFunction · 0.85
getMethod · 0.65
statMethod · 0.65

Tested by

no test coverage detected