| 74 | // |
| 75 | // Endpoints that need a project directory take an EXPLICIT reference: `project` is a |
| 76 | // registered project name, `path` an absolute directory. Exactly one of the two — the |
| 77 | // old polymorphic name-or-path guessing is gone. |
| 78 | type ProjectRef = { ok: true; dir: string } | { ok: false; error: string; status: 400 | 404 }; |
| 79 | |
| 80 | async function resolveProjectRef( |
| 81 | project: string | undefined, |
| 82 | dirPath: string | undefined, |
| 83 | ): Promise<ProjectRef> { |
| 84 | if (project !== undefined && dirPath !== undefined) { |
| 85 | return { |