Simply exposing url as a special winget() parameter would mostly solve my problem.
winget(user,null,"url")
Returns:
Current world connected to in the form of ip:port.
If the connection has failed or died, returns "null"
If the current world is an offline single-player world, the url will return "127.0.0.1:0".
This would not be useful information for a server-side winget(), however it would be useful information for a responsive client-side interface using .winget called from javascript, seeing as javascript continues to run on the client after the connection has died.
This would allow the game developer control over what happens when a link() connection has failed or when a player's internet connection to a live server has died, allowing the developer to write client-side code that will actually inform the user of what has happened and give them the option to reconnect or in general to fail gracefully.