The following is a quote from my textbook, in a chapter discussing the Viterbi algorithm (Durbin, Richard, et al. Biological sequence analysis: probabilistic models of proteins and nucleic acids. 1st edition p56)
...The most probable path $π^∗$ can be found recursively. Suppose the probability $v_{k}\left(i\right)$ of the most probable path ending in state $k$ with observation $i$ is known for all the states $k$. Then these probabilities can be calculated for observation $x_{i+1}$ as $$v_{l}\left(i+1\right)=e_{l}\left(x_{i+1}\right)\underset{k}{\max}\left(v_{k}\left(i\right)a_{k,l}\right)$$
Context: The setting is a hidden Markov model, where $\pi_{i}$ is the hidden state at step $i$, and $x_{i}$ is the observation at step $i$. Irrelevant to the question but also worth noting: $e_{l}(x_{i})$ is the emission probability of observation $x_{i}$ given state $\pi_{l}$ and $a_{k,l}$ is the transfer probability from state $\pi_{k}$ to state $\pi_{l}$
Question: How should I interpret "the probability of the most probable path ending in state $k$ with observation $i$"? Is it $$(1)\ \ \ v_{k}\left(i\right)=\underset{\pi_{1},\ldots,\pi_{i-1}}{\max}\left(p\left(\pi_{1},\ldots,\pi_{i-1},\pi_{i}=k\mid x_{1},\ldots,x_{i}\right)\right)$$
or
$$(2)\ \ \ v_{k}\left(i\right)=\underset{\pi_{1},\ldots,\pi_{i-1}}{\max}\left(p\left(\pi_{1},\ldots,\pi_{i-1}\mid x_{1},\ldots,x_{i}, \pi_{i}=k\right)\right)$$