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

Function remove

packages/server/src/start.ts:493–514  ·  view source on GitHub ↗
(sessionId: string, connectionId: string, wirePaths: readonly string[])

Source from the content-addressed store, hash-verified

491 }
492 },
493 async remove(sessionId: string, connectionId: string, wirePaths: readonly string[]) {
494 try {
495 const session = await sessionService.get(sessionId);
496 const realCwd = await fspPromises.realpath(session.metadata.cwd);
497 const absPaths: string[] = [];
498 for (const p of wirePaths) {
499
500 const safe = await resolveSafePath(session.metadata.cwd, p);
501 absPaths.push(safe.absolute);
502 }
503 fsWatcher.removePaths(sessionId, connectionId, absPaths);
504 const watched = fsWatcher.watchedPaths(connectionId, sessionId);
505 const wire = watched.map((abs) => toPosixRelativeForCwd(realCwd, abs));
506 return {
507 ok: true as const,
508 watched_paths: wire,
509 current_count: fsWatcher.countForConnection(connectionId),
510 };
511 } catch (error) {
512 return mapFsWatchError(error);
513 }
514 },
515 cleanupConnection(connectionId: string) {
516 fsWatcher.forgetConnection(connectionId);
517 },

Callers

nothing calls this directly

Calls 8

resolveSafePathFunction · 0.90
toPosixRelativeForCwdFunction · 0.85
mapFsWatchErrorFunction · 0.85
getMethod · 0.65
removePathsMethod · 0.65
watchedPathsMethod · 0.65
countForConnectionMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected