  In this paper, we develop a theory of bordered $\mathit{HF}^-$ using the link
surgery formula of Manolescu and Ozsv\'{a}th. We interpret their link surgery
complexes as type-$D$ modules over an associative algebra $\mathcal{K}$, which
we introduce. We prove a connected sum formula, which we interpret as an
$A_\infty$-tensor product over our algebra $\mathcal{K}$. Topologically, this
connected sum formula may be viewed as a formula for gluing along torus
boundary components. We compute several important examples. We show that the
dual knot formula of Hedden--Levine and Eftekhary may be interpreted as the
$DA$-bimodule for a particular diffeomorphism of the torus. As another example,
if $K_1$ and $K_2$ are knots in $S^3$, and $Y$ is obtained by gluing the
complements of $K_1$ and $K_2$ together using an orientation reversing
diffeomorphism of their boundaries, then our theory may be used to compute
$\mathit{CF}^-(Y)$ from $\mathit{CFK}^\infty(K_1)$ and
$\mathit{CFK}^\infty(K_2)$. We additionally compute the type-$D$ modules for
rationally framed solid tori. Our theory also computes the Heegaard Floer
homology of all 3-manifolds which bound a plumbing of a tree of disk bundles
over 2-spheres. In a subsequent article, we use this work to verify
N\'{e}methi's conjecture about lattice homology.
