I've thought about hooking into messages w/ a running mac before... Do you have a high level description of your approach? I looked in the iMessage GraphQL Server server repo for docs but didn't see anything obvious...
On a quick investigation I noticed you are reading the sqlite db... but it wasn't super clear how you send/receive messages?