( task: DiscoveryTaskType, rootPath: string )
| 92 | } |
| 93 | |
| 94 | async 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 | |
| 117 | async function runCodebaseContext( |
| 118 | _task: DiscoveryTaskType, |
nothing calls this directly
no test coverage detected