Just to update - this isn't that easy! A lot of the Logistics request system has changed (eg sections), and it's important not to trim items that put you under your logistics limits (otherwise a bot will have to replace what was just trimmed, and then it gets trimmed again = loop!).
Also, "quality" is an issue - I'm not really dealing with it yet as I think it's SA only, but the API suggests you can request eg "item x at >= quality level y" with a full range of comparator operations including "any quality", which means that deciding whether an inventory item can be trimmed might be quite involved. OTOH, my impression is that you can only select a specific quality, or any. I'll try to make it handle that case, anyway.