MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / groupSkillsBySource

Function groupSkillsBySource

src/skill-manager.ts:33–49  ·  view source on GitHub ↗
(skills: SkillEntry[])

Source from the content-addressed store, hash-verified

31}
32
33function groupSkillsBySource(skills: SkillEntry[]): InstallGroup[] {
34 const groups = new Map<string, string[]>();
35
36 for (const skill of skills) {
37 const source = skill.source.trim();
38 const name = skill.name.trim();
39 const names = groups.get(source) ?? [];
40
41 if (!names.some((entry) => normalizeName(entry) === normalizeName(name))) {
42 names.push(name);
43 }
44
45 groups.set(source, names);
46 }
47
48 return Array.from(groups, ([source, names]) => ({ source, names }));
49}
50
51function buildInstallArgs(group: InstallGroup): string[] {
52 const args = [

Callers 1

installSkillsFunction · 0.85

Calls 1

normalizeNameFunction · 0.85

Tested by

no test coverage detected