In the mid 90’s, we only had contractors working on my ship when we were in port. Large scale stuff like rebuilding bulkheads and upgrades. They were done and gone by the time we went underway.
I thought I read that carriers had contract aviation maintenance that worked aboard when at sea.
I have no first hand knowledge, just asking.