SAN FRANSCISO -- Pitcher Johnny Cueto and the San Francisco Giants have agreed to a six-year contract, pending a physical.