(cwd?: string)
| 226 | }; |
| 227 | |
| 228 | const resolveServerUrlForCwd = async (cwd?: string): Promise<string | undefined> => { |
| 229 | const r = await resolveStickyProjectDir(cwd, stickyProjectDir, rootsFallback); |
| 230 | stickyProjectDir = r.nextSticky ?? stickyProjectDir; |
| 231 | if (r.projectDir === undefined) return undefined; |
| 232 | if (r.viaRootGuess) void maybeWarnWorktreeAmbiguity(r.projectDir); |
| 233 | const projectDir = r.projectDir; |
| 234 | const config = await resolveConfigForCwd(projectDir); |
| 235 | const mcpUrl = await resolveMcpHttpUrl({ |
| 236 | lockDir: getLocalDir(projectDir), |
| 237 | contentDir: resolveContentDir(config, projectDir), |
| 238 | envAutoStart, |
| 239 | ...(spawnTimeoutMs !== undefined ? { timeoutMs: spawnTimeoutMs } : {}), |
| 240 | }); |
| 241 | ensureKeepaliveForProject(projectDir); |
| 242 | return mcpUrl.replace(/\/mcp$/, ''); |
| 243 | }; |
| 244 | |
| 245 | server.server.oninitialized = () => { |
| 246 | const clientInfo = server.server.getClientVersion(); |
nothing calls this directly
no test coverage detected