Text this: A categorical semantics of quantum protocols