MCPcopy
hub / github.com/npmx-dev/npmx.dev / handleDiscovery

Function handleDiscovery

server/routes/skills/[...pkg].get.ts:79–89  ·  view source on GitHub ↗
(packageName: string, version: string)

Source from the content-addressed store, hash-verified

77)
78
79async function handleDiscovery(packageName: string, version: string): Promise<SkillsListResponse> {
80 const fileTree = await getPackageFileTree(packageName, version)
81 const skillDirs = findSkillDirs(fileTree.tree)
82
83 if (skillDirs.length === 0) {
84 return { package: packageName, version, skills: [] }
85 }
86
87 const skills = await fetchSkillsList(packageName, version, skillDirs)
88 return { package: packageName, version, skills }
89}
90
91async function handleSkillContent(
92 packageName: string,

Callers 1

[...pkg].get.tsFile · 0.85

Calls 3

getPackageFileTreeFunction · 0.85
findSkillDirsFunction · 0.85
fetchSkillsListFunction · 0.85

Tested by

no test coverage detected