Not to disagree with you, but ...
It astounds me that there are still jobs for developers. I'm not talking about SV stars, I mean the hundreds of thousands of programmers writing CRUD apps around the country. That is eminently moveable, and if the stereotypical code quality of the stereotypical foreign outsourcing shop is sub par, it's not because they don't have the same brains as we do, it's merely because a) they haven't caught up with us yet (they will), and b) they haven't captured that work as primary developers yet, they're still learning to take that work by being (at the moment) sub contractors.
Japan after World War II, for example, broke into the market by making "cheap plastic crap" and motorcycles. Then better plastic crap and small cars (remember the Honda 600?). Then really good plastic crap and really good cars, and now that pie is divided among many more people around the world, including "our" pie.
Why will software be any different? It takes no resources except a brain, a computer and a connection. The whole world has the same quality of brains and computers as we, and their connection quality is often much better and cheaper than ours.