§
    øžyj’  ã                   óª   — U d Z ddlmZmZ ddlmZ daeeeeegdf                  e	d<   deeeeegdf                  ddfd„Z
defd	„Zd
ededefd„ZdS )a  Bridge desktop-only tools to Hermes-desktop renderer events.

The preview pane, pane focus, and friends live in the desktop renderer, so
desktop-gated tools reach them through an emitter the desktop ``tui_gateway``
installs at session start via :func:`set_emitter`. Everywhere else it stays
``None`` and the tools report "desktop only". Routing keys off
``HERMES_UI_SESSION_ID`` so the event lands on the window that owns the turn
(``_emit``/``write_json`` is ``_stdout_lock``-guarded, so emitting from the
tool's thread is safe).
é    )ÚCallableÚOptional)Úget_session_envNÚ_emitÚfnÚreturnc                 ó
   — | a dS )zJInstall (or clear) the renderer-event sink. Called by the desktop gateway.N©r   )r   s    ú6/home/ragecks/.hermes/hermes-agent/tools/desktop_ui.pyÚset_emitterr      s   € ð €E€E€Eó    c                  ó   — t           duS )z>True when running under the desktop app (an emitter is wired).Nr
   © r   r   Ú	availabler      s   € å˜ÐÐr   ÚeventÚpayloadc                 óR   — t           }|€dS  |t          dd¦  «        | |¦  «         dS )z…Route ``event`` to the window that owns the current turn.

    Returns ``False`` when no emitter is wired (i.e. not the desktop app).NFÚHERMES_UI_SESSION_IDÚ T)r   r   )r   r   r   s      r   Úemitr       s7   € õ 
€BØ	€zØˆuØ€B…Ð-¨rÑ2Ô2°E¸7ÑCÔCÐCØˆ4r   )Ú__doc__Útypingr   r   Úgateway.session_contextr   r   ÚstrÚdictÚ__annotations__r   Úboolr   r   r   r   r   ú<module>r      sî   ðð	ð 	ð 	ð &Ð %Ð %Ð %Ð %Ð %Ð %Ð %à 3Ð 3Ð 3Ð 3Ð 3Ð 3ð 59€€x�˜#˜s DÐ)¨4Ð/Ô0Ô1Ð 8Ð 8Ñ 8ð�H˜X s¨C°Ð&6¸Ð&<Ô=Ô>ð À4ð ð ð ð ð�4ð ð ð ð ð
�ð ˜dð  tð ð ð ð ð ð r   