
    i                    4    d Z ddlmZ ddd
ZdddZdddZdS )u   Rendering bridge — routes TUI content through Python-side renderers.

When agent.rich_output exists, its functions are used. When it doesn't,
everything returns None and the TUI falls back to its own markdown.tsx.
    )annotationsP   textstrcolsintreturn
str | Nonec                    	 ddl m} n# t          $ r Y d S w xY w	  || |          S # t          $ r  ||           cY S t          $ r Y d S w xY w)Nr   )format_responser   )agent.rich_outputr   ImportError	TypeError	Exception)r   r   r   s      1/usr/local/lib/hermes-agent/tui_gateway/render.pyrender_messager   
   s    5555555   ttt$//// % % %t$$$$$   tt    	 
( A	AAc                    	 ddl m} n# t          $ r Y d S w xY w	  || |          S # t          $ r  ||           cY S t          $ r Y d S w xY w)Nr   )render_diffr   )r   r   r   r   r   )r   r   _rds      r   r   r      s    8888888   tts4d####   s4yy   ttr   c                    	 ddl m} n# t          $ r Y d S w xY w	  ||           S # t          $ r  |            cY S t          $ r Y d S w xY w)Nr   )StreamingRendererr   )r   r   r   r   r   )r   r   s     r   make_stream_rendererr   &   s    7777777   tt  d++++ # # #  """""   tts    	 
' A
	A
	A
N)r   )r   r   r   r   r	   r
   )r   r   )__doc__
__future__r   r   r   r        r   <module>r      sx     # " " " " "              r   