Well, kudos to you my friend. It looked like you just reimplemented the python library in js/ts, but you've drilled all the way down. I was curious about doing a similar thing for a Sony E-reader that doesn't have modern os support and only ever had a closed source application for it. Do you have any articles on the process you went through?
It‘s still on Github and I should probably get back to working on it again.