  We construct an extended oriented $(2+\epsilon)$-dimensional topological
field theory, the character field theory $X_G$ attached to a affine algebraic
group in characteristic zero, which calculates the homology of character
varieties of surfaces. It is a model for a dimensional reduction of
Kapustin-Witten theory ($N=4$ $d=4$ super-Yang-Mills in the GL twist), and a
universal version of the unipotent character field theory introduced in
arXiv:0904.1247. Boundary conditions in $X_G$ are given by quantum Hamiltonian
$G$-spaces, as captured by de Rham (or strong) $G$-categories, i.e., module
categories for the monoidal dg category $D(G)$ of $D$-modules on $G$. We show
that the circle integral $X_G(S^1)$ (the center and trace of $D(G)$) is
identified with the category $D(G/G)$ of "class $D$-modules", while for an
oriented surface $S$ (with arbitrary decorations at punctures) we show that
$X_G(S)\simeq{\rm H}_*^{BM}(Loc_G(S))$ is the Borel-Moore homology of the
corresponding character stack. We also describe the "Hodge filtration" on the
character theory, a one parameter degeneration to a TFT whose boundary
conditions are given by classical Hamiltonian $G$-spaces, and which encodes a
variant of the Hodge filtration on character varieties.
