text: Title: "Publish Agent" window should sort Agents in the same order as the Library
  Body: [https://github.com/Significant-Gravitas/AutoGPT/issues/9141](https://github.com/Significant-Gravitas/AutoGPT/issues/9141) is going to fix the order of Agents in the library, but the "Publish Agent" window also shows Agents in a different. random order.<br><br>This window should also instead sort Agents based on the most recently edited Agent.
  
  Ideally we reuse the same code for both of these.