MCPcopy Create free account
hub / github.com/cobusgreyling/loop-engineering / loadPatternDoc

Function loadPatternDoc

tools/mcp-server/src/resolver.ts:94–104  ·  view source on GitHub ↗
(root: string, patternId: string)

Source from the content-addressed store, hash-verified

92}
93
94export async function loadPatternDoc(root: string, patternId: string): Promise<string | null> {
95 try {
96 assertSafeSegment(patternId, 'patternId');
97 } catch {
98 return null;
99 }
100 const allowed = await allowedPatternIds(root);
101 if (!allowed.has(patternId)) return null;
102 const filePath = path.join(root, 'patterns', `${patternId}.md`);
103 return readFileIfExists(filePath);
104}
105
106export async function listSkills(root: string): Promise<SkillInfo[]> {
107 const skillDirs = [

Callers 2

server.test.mjsFile · 0.85
index.tsFile · 0.85

Calls 3

assertSafeSegmentFunction · 0.85
allowedPatternIdsFunction · 0.85
readFileIfExistsFunction · 0.85

Tested by

no test coverage detected