The results published at https://ucs-detect.readthedocs.io/ are collected automatically by interrogation of a live terminal, and reports more granular details of XTVERSION, XTGETTCAP, many DEC Private modes, etc., in YAML files.
They are a bit long and slow to process but it might be of interest to you, it would probably do well as a submodule of this repository for your scripts.
The results published at https://ucs-detect.readthedocs.io/ are collected automatically by interrogation of a live terminal, and reports more granular details of XTVERSION, XTGETTCAP, many DEC Private modes, etc., in YAML files.
They are a bit long and slow to process but it might be of interest to you, it would probably do well as a submodule of this repository for your scripts.