MCPcopy Create free account
hub / github.com/Railly/agentfiles / scanToolProjectPaths

Function scanToolProjectPaths

src/scanner.ts:242–258  ·  view source on GitHub ↗
(
	projectRoot: string,
	tool: ToolConfig
)

Source from the content-addressed store, hash-verified

240}
241
242function scanToolProjectPaths(
243 projectRoot: string,
244 tool: ToolConfig
245): SkillItem[] {
246 const home = homedir();
247 const results: SkillItem[] = [];
248 for (const sp of [...tool.paths, ...tool.agentPaths]) {
249 const rel = relative(home, sp.baseDir);
250 if (rel.startsWith("..") || rel.startsWith("/")) continue;
251 const projectPath = join(projectRoot, rel);
252 if (!existsSync(projectPath)) continue;
253 try {
254 results.push(...scanPath({ ...sp, baseDir: projectPath }, tool.id));
255 } catch { /* permission errors, broken symlinks, etc */ }
256 }
257 return results;
258}
259
260function scanProjectRoots(settings: ChopsSettings): { items: SkillItem[]; toolId: string }[] {
261 const homeDir = getProjectsHomeDir(settings);

Callers 1

scanProjectRootsFunction · 0.85

Calls 1

scanPathFunction · 0.85

Tested by

no test coverage detected