Can't speak to Yoink but I built a project a year or two ago that did something similar. I used a stupid simple method - input simulation (using the fantastic enigo library). And if you want context, you can simulate select all + copy, and access via clipboard. Similar if you want to replace, etc.

https://github.com/jasonjmcghee/plock

The goal of this project was to just be able to pipe / run arbitrary commands from any text context. But, that lined up well with LLMs usage.