Messages are forwareded when received from another link, this means it's too late to throw an error that bubbles up to the code trying to send the incorrect message thus defeating the purpose of the validation.
Add a TypeScript build suitable for incremental migration to TypeScript to the lib package.
Move the majority of the script files into a src directory to be consistent with the organisation of the other packages.