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

Function runTeamPatterns

src/eval/discovery-harness.ts:94–115  ·  view source on GitHub ↗
(
  task: DiscoveryTaskType,
  rootPath: string
)

Source from the content-addressed store, hash-verified

92}
93
94async function runTeamPatterns(
95 task: DiscoveryTaskType,
96 rootPath: string
97): Promise<DiscoverySurfaceResultType> {
98 const project = createToolProject(rootPath);
99 const response = await getTeamPatternsHandle(task.args ?? { category: 'all' }, {
100 indexState: project.indexState,
101 paths: project.paths,
102 rootPath: project.rootPath,
103 performIndexing: () => undefined
104 });
105 const payload = response.content?.[0]?.text ?? '{}';
106 const parsed = parseJsonPayload(payload) as PatternResponse & JsonRecord;
107 const goldenFiles = Array.isArray(parsed.goldenFiles) ? parsed.goldenFiles : [];
108 return {
109 payload,
110 bestExample:
111 goldenFiles.length > 0 && typeof goldenFiles[0]?.file === 'string'
112 ? goldenFiles[0].file
113 : null
114 };
115}
116
117async function runCodebaseContext(
118 _task: DiscoveryTaskType,

Callers

nothing calls this directly

Calls 2

createToolProjectFunction · 0.85
parseJsonPayloadFunction · 0.85

Tested by

no test coverage detected