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

Function normalizeInstallRoot

packages/agent-core/src/plugin/manager.ts:317–332  ·  view source on GitHub ↗
(rootPath: string)

Source from the content-addressed store, hash-verified

315}
316
317async function normalizeInstallRoot(rootPath: string): Promise<string> {
318 const trimmed = rootPath.trim();
319 if (!path.isAbsolute(trimmed)) {
320 throw new Error(`Plugin root must be an absolute path (got "${rootPath}")`);
321 }
322 let resolved: string;
323 try {
324 resolved = await realpath(trimmed);
325 } catch (error) {
326 throw new Error(`Plugin root does not exist: ${trimmed}`, { cause: error });
327 }
328 if (!(await stat(resolved)).isDirectory()) {
329 throw new Error(`Plugin root is not a directory: ${trimmed}`);
330 }
331 return resolved;
332}
333
334async function copyPluginToManagedRoot(
335 kimiHomeDir: string,

Callers 1

installMethod · 0.85

Calls 2

realpathFunction · 0.50
statFunction · 0.50

Tested by

no test coverage detected