This compose scripts API first appeared in Thunderbird 77. Functionally it is the same as the content scripts API except that it works on the document of email messages during composition. See the MDN documentation for a more in-depth explanation and Changes in Thunderbird 77 for examples.
Registering a compose script through
manifest.json is not possible at this point.
compose is required to use
An object that represents a compose script registered programmatically
unregister()Unregister a compose script registered programmatically