The only way you might currently achieve this right now is by writing a script that automatically generates the
_Sidebar.<extension> file based on some custom criteria and the page files present in the Wiki repository.
This shouldn’t be hard to achiveve, provided you have at least Collaborator access to the repository, so that you can clone it locally and push to it. I actually use similar script to maintain some auto-generated pages in various Wikis (not for TOCs or sidebars, but the principle is similar).
The downside is that only maintainers will be able to update the TOC, and will have to do it periodically, locally, and push the updated sidebar each time.
From what I gather, it’s not currently possible to leverage CI services or GitHub Actions for Wikis, so it will have to rely on scripted automation.
Here’s an example of an auto-generated Wiki page and the script used:
I hope it might be of help or inspiration.