MCPcopy Index your code
hub / github.com/Waishnav/devspace / resolveSkillReadPath

Function resolveSkillReadPath

src/skills.ts:55–78  ·  view source on GitHub ↗
(
  skills: Skill[],
  activatedSkillDirs: Set<string>,
  inputPath: string,
)

Source from the content-addressed store, hash-verified

53}
54
55export function resolveSkillReadPath(
56 skills: Skill[],
57 activatedSkillDirs: Set<string>,
58 inputPath: string,
59): SkillReadResolution | undefined {
60 const absolutePath = resolve(expandHomePath(inputPath));
61
62 for (const skill of skills) {
63 const skillFilePath = resolve(skill.filePath);
64 if (absolutePath === skillFilePath) {
65 return { absolutePath, skill, isSkillFile: true };
66 }
67 }
68
69 for (const skill of skills) {
70 const baseDir = resolve(skill.baseDir);
71 if (!activatedSkillDirs.has(baseDir)) continue;
72 if (!isPathInsideRoot(absolutePath, baseDir)) continue;
73
74 return { absolutePath, skill, isSkillFile: false };
75 }
76
77 return undefined;
78}
79
80export function markSkillActivated(
81 activatedSkillDirs: Set<string>,

Callers 2

skills.test.tsFile · 0.85
resolveReadPathMethod · 0.85

Calls 2

expandHomePathFunction · 0.85
isPathInsideRootFunction · 0.85

Tested by

no test coverage detected