(
serverId: string | undefined,
)
| 193 | // undefined and exactly one descriptor is registered, default to that sole |
| 194 | // descriptor; with zero or multiple, undefined stays unresolvable. |
| 195 | const resolveFromRegistry = ( |
| 196 | serverId: string | undefined, |
| 197 | ): McpServerDescriptor | null => { |
| 198 | if (serverId !== undefined) { |
| 199 | return registry.byServerId[serverId] ?? null |
| 200 | } |
| 201 | if (registry.total !== 1) return null |
| 202 | return registry.fallback ?? Object.values(registry.byServerId)[0] ?? null |
| 203 | } |
| 204 | |
| 205 | return async ( |
| 206 | req: McpAppCallRequest, |
no test coverage detected