How to solve unknown objects in my own library

Hello,
I am totally new in creating my own libraries with juce. And at this stage I have issue which I am not sure how to solve. I think that using library sounds quite reasonably. But I have some mess in my head and I would like to ask you for any advices, for which I thanks a lot in advance.

My case looks like that. I want to build plugins with some functionalities which would work only if separated application is running. I mean one instance of application which would manage several instances of various plugins.

So I think the solution could be to create my own library with singleton with methods which I could call from my plugins projects. But what those method will do (all it’s algorithms) I want to implement only in my application project. I don’t want to create whole application functionalities inside library.

But then I have problem because my library doesn’t know anything about code in my application. So I need to move that code to library but then I end up on implementation everything in my library which I would like to avoid.

I am not sure how to solve it?
I think that maybe I could use in my singleton some lambdas (or std::functions) which would be defined after my application is running, and set to empty again after application is quited. But I am not sure if it’s optimal solution. I would also like to have in my singleton some objects which would be defined in application project. So using std::functions seems to be not enaugh or it will be some breakneck solutions.

Maybe anyone could give me some advices?

For any help great thanks in advance.

Best Regards