The source of a web page is parsed to form DOM and accessibility trees. The character stream of a TUI can’t be parsed into anything similar because it is not given in a formal language that can express those structures.
You've given me some great points to think about, thank you for the engaging conversation.