Job cuts in the US have surged to record levels, with the rise of artificial intelligence helping drive the trend.