This repository includes the code that consumes the XPC service provided by a Launch Agent. To read the article that describes the code, you can find it here:
https://rderik.com/blog/creating-a-launch-agent-that-provides-an-xpc-service-on-macos-using-swift/