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

Function pushExistingRoot

packages/agent-core/src/skill/scanner.ts:329–340  ·  view source on GitHub ↗
(
  out: SkillRoot[],
  dir: string,
  source: SkillSource,
  isDir: (p: string) => Promise<boolean>,
  realpath: (p: string) => Promise<string>,
)

Source from the content-addressed store, hash-verified

327}
328
329async function pushExistingRoot(
330 out: SkillRoot[],
331 dir: string,
332 source: SkillSource,
333 isDir: (p: string) => Promise<boolean>,
334 realpath: (p: string) => Promise<string>,
335): Promise<boolean> {
336 if (!(await isDir(dir))) return false;
337 const resolved = await realpath(dir);
338 if (!out.some((root) => root.path === resolved)) out.push({ path: resolved, source });
339 return true;
340}
341
342async function pushProvidedRoot(
343 out: SkillRoot[],

Callers 4

resolveSkillRootsFunction · 0.85
pushFirstExistingFunction · 0.85
pushBrandGroupFunction · 0.85
pushConfiguredDirsFunction · 0.85

Calls 3

isDirFunction · 0.85
realpathFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected