+
    lHàjè  ã                   óî   € R t ^ RIHt ^ RIHtHt ^ RIHtHt R&R R llt	RR RR	 R
R /t
R tRRRRRRRRRRRR. R'O/RRRRR/RRRRR/RRRRR/RRRRR //R!R.//t]P                  ! RR"]]R#R$7       R%# )(u�  The `desktop_preview` tool â€” the preview pane beside the chat, as ONE tool.

open/close/read used to be three tools that each re-taught "the preview pane" world;
one action enum states it once (~576 -> ~210 schema tokens). action=read keeps its
agent-level callback dispatch (agent_runtime_helpers -> agent.read_preview_callback).
Lives in the ``desktop_ui`` toolset â€” desktop-app sessions only.
)Ú
desktop_ui)Ú_normalize_targetÚopen_preview_tool)ÚregistryÚ
tool_errorc                ó0   € V ^8„  d   QhR\         R\         /# )é   ÚurlÚreturn)Ústr)Úformats   "Ú7/home/ubuntu/.hermes/hermes-agent/tools/preview_tool.pyÚ__annotate__r      s   € ÷ ñ ”sð ¤Cñ ó    c                 ó€   € \        T ;'       g    R 4      p\        P                  ! RRV/RRRRRT;'       g    R/4      # )	Ú zpreview.closer	   zFailed to close the preview: z=The preview pane is only available in the Hermes desktop app.ÚsuccessTÚclosedÚall)r   r   Úemit_or_error)r	   Útargets   & r   Úpreview_closer      sG   € Ü˜sŸy˜y bÓ)€FÜ×#Ò#ØØ	�ˆØ'ØGØ	�D˜( F§O O¨eÐ4óð r   Úopenc                 ó\   € \        V P                  R R4      V P                  RR4      R7      # )r	   r   Úlabel)r	   r   )r   Úget©Úargss   &r   Ú<lambda>r      s$   € Ô*¨t¯x©x¸¸rÓ/BÈ$Ï(É(ÐSZÐ\^ÓJ_Õ`r   Úclosec                 ó:   € \        V P                  R R4      R7      # )r	   r   )r	   )r   r   r   s   &r   r   r      s   € œ-¨D¯H©H°U¸BÓ,?Õ@r   Úreadc                 ó   € \        R 4      # )zFpreview read must run inside a desktop session (no GUI callback here).)r   r   s   &r   r   r      s   € œØPôRr   c                ó¨   € \         P                  V P                  R4      ;'       g    RP                  4       4      pVf   \        R4      # V! V 4      # )zDNon-read actions only: action=read is dispatched at the agent level.Úactionr   z)action must be one of: open, close, read.)Ú_ACTIONSr   Ústripr   )r   ÚkwÚfns   &, r   Ú_handle_previewr)   #   sD   € ä	�‰�t—x‘x Ó)×/Ð/¨R×6Ñ6Ó8Ó	9€BØ	‚zÜÐEÓFÐFÙˆd‹8€Or   ÚnameÚdesktop_previewÚdescriptionuú  Open, close, or read the preview pane beside the chat. open: show a web URL (bare domains fine), a localhost dev server, or a file path (HTML renders live) â€” opens for the current window only. close: dismiss the whole pane, or one tab via url. read: what the pane currently shows â€” returns {kind, url, title, text, start, end, total_chars}; a Browser tab's text is the rendered page's visible text, paged with start/count (char offsets); a file tab answers identity only (read the file with read_file).Ú
parametersÚtypeÚobjectÚ
propertiesr$   ÚstringÚenumr	   z;open: the target. close: one tab (omit for the whole pane).r   zopen: optional tab label.ÚstartÚintegerzread: 0-indexed char offset.Úcountz(read: chars to return (capped per read).Úrequiredr   u   ðŸ–¼ï¸�)r*   ÚtoolsetÚschemaÚhandlerÚemojiN)r   )r   r   r!   )Ú__doc__Útoolsr   Útools.open_preview_toolr   r   Útools.registryr   r   r   r%   r)   ÚPREVIEW_SCHEMAÚregister© r   r   Ú<module>rB      sä   ðñõ ß Hß /÷ð Ñ`ØÑ@à
ñ Rð	€òð ÐØð	ð Ø�ØØ�v˜x¨Ò1JÐKØØ˜ØÐ\ðð �f˜h¨Ð7RÐSØ�f˜i¨Ð8VÐWØ�f˜i¨Ð8bÐcð	
ð 	�X�Jðð€ð: 	× Ò Ø	ØØØØ
÷r   