MCPcopy Create free account
hub / github.com/vercel/vercel / findEntrypointCandidates

Function findEntrypointCandidates

packages/python/src/entrypoint.ts:194–212  ·  view source on GitHub ↗

* Recursive scan returning every .py file that exports a valid app/handler. * Used only on the error path to suggest a tool.vercel.entrypoint snippet.

(
  workPath: string
)

Source from the content-addressed store, hash-verified

192 * Used only on the error path to suggest a tool.vercel.entrypoint snippet.
193 */
194async function findEntrypointCandidates(
195 workPath: string
196): Promise<PythonEntrypoint[]> {
197 const pyFiles = await findPythonFilesRecursive(workPath, workPath);
198 const candidates: PythonEntrypoint[] = [];
199 for (const relPath of pyFiles) {
200 try {
201 const content = await fs.promises.readFile(
202 join(workPath, relPath),
203 'utf-8'
204 );
205 const varName = await findAppOrHandler(content);
206 if (varName) {
207 candidates.push({ entrypoint: relPath, variableName: varName });
208 }
209 } catch {}
210 }
211 return candidates;
212}
213
214function renderCandidateSuggestion(candidates: PythonEntrypoint[]): string {
215 const lines = candidates.map(

Callers 1

detectPythonEntrypointFunction · 0.85

Calls 3

findAppOrHandlerFunction · 0.90
findPythonFilesRecursiveFunction · 0.85
pushMethod · 0.65

Tested by

no test coverage detected