Solution (source code)

= Solution

A <Brownian excursion in the upper half-plane> from $0$ to infinity is killed <planar Brownian motion> conditioned to stay in $\mathbb H$, with its entrance law at $0$. Precisely, it is the <Doob h-transform> for $h(z)=\operatorname{Im}z$, obtained by starting at $i\varepsilon$ and letting $\varepsilon\downarrow0$. Equivalently,
$$
\boxed{\widehat B_t=W_t+iR_t,}
$$
where $W$ is standard <Brownian motion> and the independent process $R$ is a dimension-three <Bessel process> started at zero. The transformed generator is $\frac12\Delta+y^{-1}\partial_y$, which explains this representation.

First compute avoidance from an interior point $z$. Let $\tau$ be the exit time of ordinary <planar Brownian motion> from $\mathbb H\setminus A$. The harmonic correction
$$
v(z)=\operatorname{Im}\bigl(z-g_A(z)\bigr)
$$
has boundary values $\operatorname{Im}z$ on $A$ and zero on the real axis. The <hydrodynamic normalization at infinity> gives $g_A(z)=z+\operatorname{hcap}(A)/z+O(|z|^{-2})$. Together with the <maximum principle for harmonic functions> this gives the useful bound $0\leq v\leq\sup_{a\in A}\operatorname{Im}a$. Since ordinary <Brownian motion> hits the real axis almost surely, the <optional stopping theorem> applied to this bounded <harmonic function> gives
$$
v(z)=\mathbb E_z[\operatorname{Im}B_\tau]
=\mathbb E_z[\operatorname{Im}B_\tau\,\mathbf1_{\{B_\tau\in A\}}].
$$
The <Doob h-transform> weights a stopped path by its final height divided by its initial height. Applying this at the first hit of $A$, with bounded-time localization and then a limit, therefore yields
$$
\mathbb P_z^h(\tau_A<\infty)=\frac{v(z)}{\operatorname{Im}z},\qquad
\mathbb P_z^h(\tau_A=\infty)=\frac{\operatorname{Im}g_A(z)}{\operatorname{Im}z}.
$$
For the entrance law the same result follows by conditioning at a small positive time and letting that time decrease to zero: the avoidance function has the boundary limit computed next, and the excursion is initially in a neighbourhood disjoint from $A$.

Because the closure of the hull avoids $0$, the <Schwarz reflection principle> makes $g_A$ analytic in a neighbourhood of zero, with real $g_A(0)$ and positive real $g_A'(0)$. Thus
$$
\lim_{\varepsilon\downarrow0}\frac{\operatorname{Im}g_A(i\varepsilon)}{\varepsilon}=g_A'(0).
$$
In fact, the reflected Taylor expansion gives $\operatorname{Im}g_A(z)/\operatorname{Im}z=g_A'(0)+O(|z|)$ uniformly as $z\to0$ inside the half-plane, so the same limit applies to the entrance process. The map in the question is $\psi_A=g_A-g_A(0)$, so its derivative agrees with $g_A'$. We obtain the <restriction probability of a Brownian half-plane excursion>:
$$
\boxed{\mathbb P\bigl[\widehat B([0,\infty))\cap A=\varnothing\bigr]=\psi_A'(0).}
$$