Ë
    ãß²j  ã                   óŒ   — d Z ddlZddlmZ ddlmZmZ dedefd„Zdd	d
ddddœidgdœdœZ	 ej                  dde	d„ d¬«       y)aH  Close a read-only agent terminal tab in the Hermes desktop GUI WITHOUT killing
the mirrored ``terminal(background=true)`` process (output keeps buffering; the user
can reopen it). Routes through the process registry's ``on_close`` sink, which the
desktop gateway wires to a ``terminal.close`` event. ``desktop_ui`` toolset only.é    N)Úprocess_registry)ÚregistryÚ
tool_errorÚ
process_idÚreturnc                 ó˜   — | xs dj                  «       }|st        d«      S t        j                  t	        j
                  |«      d¬«      S )zBAsk the desktop GUI to close a background process's read-only tab.Ú zCprocess_id is required (the background process whose tab to close).F)Úensure_ascii)Ústripr   ÚjsonÚdumpsr   Úrequest_close_terminal)r   Úpids     ú>/home/ubuntu/.hermes/hermes-agent/tools/close_terminal_tool.pyÚclose_terminal_toolr      sB   € àÒ˜×
"Ñ
"Ó
$€CÙÜÐ_Ó`Ð`Ü�:‰:Ô&×=Ñ=¸cÓBÐQVÔWÐWó    Úclose_terminaluµ  Hide a background process's terminal tab (process keeps running) in the Hermes desktop GUI (the tabs mirroring terminal(background=true) runs). This does NOT kill the process â€” it only drops the tab/view; the output keeps buffering and the user can reopen it from the status stack. Use it to tidy up when a background process's live terminal is no longer worth showing. To actually stop the process, use process(action='kill') instead.ÚobjectÚstringz�The background process's session id (from terminal(background=true) output or process(action='list')) whose tab should be closed.)ÚtypeÚdescription)r   Ú
propertiesÚrequired)Únamer   Ú
parametersÚ
desktop_uic                 ó:   — t        | j                  dd«      ¬«      S )Nr   r	   )r   )r   Úget)ÚargsÚkws     r   ú<lambda>r!   2   s   € Ô2¸d¿h¹hÀ|ÐUWÓ>XÔY€ r   u   ðŸ–¥ï¸�)r   ÚtoolsetÚschemaÚhandlerÚemoji)Ú__doc__r   Útools.process_registryr   Útools.registryr   r   Ústrr   ÚCLOSE_TERMINAL_SCHEMAÚregister© r   r   ú<module>r-      s‡   ðñUó
 å 3ß /ðX Cð X¨Có Xð ð	Uð àØ ðTñð
ð "�NññÐ ð4 €× Ñ Ø	ØØ ÙYØ
ör   