But not the whole repo - Cursor indexes all your files in a vector DB and then can use RAG when querying models. Perhaps the biggest benefit I get from Cursor is that I can ask it questions about the whole repo - when working with a sizable team in a large repo, this is hugely valuable.
It uses RAG, so your whole repo is indexed locally, but of course anything relevant is put into the context window in order to get results. So in that sense it's no different from any other LLM solution, and the models you use are pluggable. You can even provide you own Open AI/Anthropic/etc. API keys.
I honestly think the "oh no, enterprises are scared about where are code goes" is overblown. I mean, companies host tons of infrastructure on AWS, GCP, Azure, etc. And heck, why would a company trust GitHub (a subsidiary of Microsoft) Enterprise's guarantees and not trust Open AI's (basically a subsidiary of Microsoft at this point) guarantees?