Writing a typst Package Importer for Guix

Hi! I’m brainstorming on how to implement a guix importer for typst documents. What’s the recommended way to list all packages a typst package transitively depends on? Does such tooling already exist?

Context

I don’t think that’s possible. Theoretically, the dependency tree of a Typst package may depend on datetime.today, the distribution of prime numbers, the typographical metrics of the Times New Roman installed on the system, or user inputs. In those cases, no programs can determine the actual dependency tree robustly.

However, there exist several practical ways.