like language server protocol or model context protocol - but for gui
The basic idea is to have a binary that is built custom made for each platform, but agnostic to the platform that is capable of being a very generic gui application. This is the 'gui app client'.
Then when it starts, it is pointed to a binary that it will start, the 'gui app server'. The gui app server basically contains the business logic of the app. The gui app server will handle all io changes through stdio - they will communicate by passing messages via stdio with JSON and some predefined schema.
The gui app client will be responsible for processing the requests made by the gui app server and also alerting the gui app server with messages when there are activities that are happening.
This is just an idea right now. I'm gonna write some code when I get a chance later.