TODO: [🧠][🏰] Maybe move all of these functions into `@promptbook/utils`