How to extend the Node Context to query an additional root node

I am currently working on a meta data prototype where I store asset meta data as nodes. For these meta data nodes I created a root “meta” aside to “sites”

Now I want to query these nodes with something like:

assets = ${q(meta).find('[instanceof Neos.MetaData:Image][authorByline*="Daniel Lienert"]').getAssets()}

This meens, I need to at a “meta” root node to the node context. What is the way to go here?
To try it out, I currently changed the context creation in the TypoScriptView like that:

    $context = $this->contextFactory->create(['workspaceName' => 'live']);
    $metaNodeData = $this->nodeDataRepository->findOneByPath('/meta', $context->getWorkspace());
    $metaNode = $this->nodeFactory->createFromNodeData($metaNodeData, $context);

    $typoScriptRuntime->pushContextArray(array(
        'node' => $currentNode,
        'meta' =>  $metaNode,
        'documentNode' => $this->getClosestDocumentNode($currentNode) ?: $currentNode,
        'site' => $currentSiteNode,
        'editPreviewMode' => isset($this->variables['editPreviewMode']) ? $this->variables['editPreviewMode'] : null
    ));

Do we have a correct extension point for that?

Maybe a simple way to make this extendable, is to emit a signal and passing the initialized context array to this signal, like this:

In your package, just listen to the signal and update the array

Feel free to send a PR with the code, it’s one of those “unplanned” extension point where you can break every thing, but when used carefully it can help a lots, maybe @sebastian or @christianm can you give us your POV ?

I would rather not want to go down that route because I feel Signal/Slot should be a one way route and using references to change something is a hack that might hit us back at some point.

I would rather want to make this extensible in some other way. I mean you can always @context in root, we just need the capability to query for the “meta” node inside of TypoScript.

I know due to the way it is constructed this will not easily work but something in the lines of it could be a way to go:

@context.meta = ${q('/meta@live').get(0)}

Thanks guys for the replies!

I also thought of a signal, but I agree with @christianm’s concerns about changing something with a signal should not be the way we should suggest.
@christianm - If I get you right, the Flowquery you proposed is just an idea but not working yet? If not - we should make that possible.
For adding context from within a package - I would prefer a way using PHP to have a minimum of interference with users TypoScript.