Always keep apps running

There are a few apps that I always want to keep running, but they keep closing for updates or cache cleaning or whatever.
I’d like them to be restarted every time - if they’re updated I don’t really care if it’s the new or old version; I just never want to discover that these apps aren’t running.

I’m talking about apps like Raycast, Rectangle, Caffeine, Tailscale, Espanso, Keyboard Maestro and so on; apps that I never notice, but if they stop working will absolutely infuriate me ;p

Is there a solution for this?

A Hammerspoon script would do it. You could optimize further since hs.application.find can detect all your apps at once and return an array of open ones.

keepAlive = hs.timer.doEvery(1, function()
    if hs.application.find('Raycast') == nil then'Raycast')
      print('Raycast reopened')
    if hs.application.find('Agenda') == nil then'Agenda')
      print('Agenda reopened')

Keyboard Maestro can do this.