( serverConfig: Awaited<ReturnType<typeof loadServerConfig>> )
| 1649 | } |
| 1650 | |
| 1651 | async function applyServerConfig( |
| 1652 | serverConfig: Awaited<ReturnType<typeof loadServerConfig>> |
| 1653 | ): Promise<void> { |
| 1654 | for (const proj of serverConfig?.projects ?? []) { |
| 1655 | try { |
| 1656 | const stats = await fs.stat(proj.root); |
| 1657 | if (!stats.isDirectory()) { |
| 1658 | console.error(`[config] Skipping non-directory project root: ${proj.root}`); |
| 1659 | continue; |
| 1660 | } |
| 1661 | const rootKey = normalizeRootKey(proj.root); |
| 1662 | configRoots.set(rootKey, { rootPath: proj.root }); |
| 1663 | registerKnownRoot(proj.root); |
| 1664 | const runtimeOverrides = buildProjectRuntimeOverrides(proj); |
| 1665 | const project = getOrCreateProject(proj.root); |
| 1666 | project.runtimeOverrides = runtimeOverrides; |
| 1667 | } catch { |
| 1668 | console.error(`[config] Skipping inaccessible project root: ${proj.root}`); |
| 1669 | } |
| 1670 | } |
| 1671 | } |
| 1672 | |
| 1673 | async function main() { |
| 1674 | await ensureMcpRuntimeLoaded(); |
no test coverage detected