I was wondering if it would be possible to take an O type star and lift material from it reducing its mass in cycles near the time the star reaches the end of its main-sequence age for each reducing mass, while harvesting energy from it throughout?
The idea is to make the most of the vast amount of energy produced by the largest stars by building Dyson swarms around them, then lifting material near the end of their main-sequence age to make them stable again but each time only reducing the mass to necessary stable levels, as little as possible to ensure the most solar energy can be harvested in the shortest time, as time goes by lifting cycles will be further apart as the stars mass reduces but hopefully it will give the greatest energy return for each star.
Another option, with the most energy to be harvested as fast as possible being the goal, would be to stabilize an O type star near the end of its main-sequence then add material back to it in cycles keeping it as an O type star mass for the foreseeable future but I am not sure if that will work as planned and it may be a waste of resources?
Could either idea be achieved successfully by an advanced civilization or would timing of lifting for the first idea be un reliable if trying to leave it as late as possible and would small decreases be possible to keep stabilize it? And is the second idea possible and likely a better idea?