Looking for a license that covers public network service, like AGPLv3, but like LGPL isn't infectious.

Basically I wrote some useful helper functions I want to allow to be used in any work, including closed-source software, but I want to require improvements to MY CODE to be released back to me and the general public.

Can you recommend a suitable license?

It should also include some of the other AGPL-permitted restrictions (attribution, indemnity), either in the license text or as permitted variations.