I built a Swift library called Operator [0] to run the core agent loop, if it would save anyone time.
[0]: https://github.com/bensyverson/Operator