MCPcopy Index your code
hub / github.com/PatrickSys/codebase-context / validateResolvedProjectPath

Function validateResolvedProjectPath

src/index.ts:711–732  ·  view source on GitHub ↗
(rootPath: string)

Source from the content-addressed store, hash-verified

709}
710
711async function validateResolvedProjectPath(rootPath: string): Promise<ToolResponse | undefined> {
712 try {
713 const stats = await fs.stat(rootPath);
714 if (!stats.isDirectory()) {
715 return buildProjectSelectionError(
716 'unknown_project',
717 `project is not a directory: ${rootPath}`
718 );
719 }
720
721 if (clientRootsEnabled && getKnownRootPaths().length > 0 && !getContainingKnownRoot(rootPath)) {
722 return buildProjectSelectionError(
723 'unknown_project',
724 'Requested project is not under an active MCP root.'
725 );
726 }
727
728 return undefined;
729 } catch {
730 return buildProjectSelectionError('unknown_project', `project does not exist: ${rootPath}`);
731 }
732}
733
734async function resolveProjectSelector(selector: string): Promise<ProjectResolution> {
735 const trimmedSelector = selector.trim();

Callers 1

Calls 3

getKnownRootPathsFunction · 0.85
getContainingKnownRootFunction · 0.85

Tested by

no test coverage detected