Ë
    ãß²j–  ã                   óÔ   — d Z ddlZddlmZ ddlmZmZ dZddededed	ed
ef
d„Z	ddddddœdddœdddœd e
e«      ddœdœddgdœdœZd
efd„Z ej                  ddeed„ d¬«       y)uM  Point at something in the Hermes desktop GUI and say one line about it â€” the quiet
sibling of ``tour`` (same ``data-tour`` handles) with no scrim/spotlight/paging.
Fire-and-forget: a tip is not a question, so blocking on a round-trip would stall the
reply. Lives in ``desktop_ui`` and withdraws itself when the user turns tips off.é    N)Ú
desktop_ui)ÚregistryÚ
tool_error)ÚtopÚrightÚbottomÚleftÚtextÚselectorÚtitleÚsideÚreturnc                 óö  — | xs dj                  «       } |xs dj                  «       }| st        d«      S |st        d«      S |r*|t        vr"t        ddj                  t        «      › d�«      S || dœd|fd	|ffD ��ci c]  \  }}|sŒ	||“Œ c}}¥}	 t	        j
                  d
|«      }|st        d«      S t        j                  d|dœd¬«      S c c}}w # t        $ r}t        d|› �«      cY d}~S d}~ww xY w)z-Show one tip bubble anchored to ``selector``.Ú u0   tip needs text â€” the one line the bubble says.z�tip needs a selector to point at. Call tour(action='targets') to see what's on screen and prefer a target reporting stable: true.zside must be one of: z, ú.)r   r
   r   r   ztip.showzFailed to show the tip: Nz0tip is only available in the Hermes desktop app.T)Úsuccessr   F)Úensure_ascii)	Ústripr   ÚSIDESÚjoinr   ÚemitÚ	ExceptionÚjsonÚdumps)	r
   r   r   r   ÚkÚvÚpayloadÚokÚexcs	            ú3/home/ubuntu/.hermes/hermes-agent/tools/tip_tool.pyÚtip_toolr!      s  € àŠJ�B×ÑÓ€DØ’˜B×%Ñ%Ó'€HÙÜÐLÓMÐMÙÜð Yó Zð 	Zá�œEÑ!ÜÐ1°$·)±)¼EÓ2BÐ1CÀ1ÐEÓFÐFØ#¨Tñ MØ%,¨eÐ$4°v¸t°nÐ#E×K™4˜1˜aÊ�!�Q‘$ÓKðM€Gð<Ü�_‰_˜Z¨Ó1ˆñ ÜÐLÓMÐMÜ�:‰: $°HÑ=ÈEÔRÐRùó Løô ò <ÜÐ4°S°EÐ:Ó;Õ;ûð<ús*   Á>
CÂ	CÂC Ã	C8Ã C3Ã-C8Ã3C8Úshow_tipu�  Point at one thing in the desktop UI with a small arrow bubble (no dimming, no tour chrome) â€” for when a sentence is clearer with a finger on its subject. Get selectors from tour(action='targets'), prefer stable:true, never guess. One tip at a time (new replaces last); say the same thing in chat too â€” the bubble is a pointer, not the message. Sparingly: a bubble every turn stops being read.ÚobjectÚstringzThe one-sentence bubble text.)ÚtypeÚdescriptionzSelector from tour targets.zOptional heading.z&Omit for 'top'; flips at screen edges.)r%   Úenumr&   ©r
   r   r   r   )r%   Ú
propertiesÚrequired)Únamer&   Ú
parametersc                  ó0   — t        j                  dd¬«      S )uH   The user's Settings â†’ Appearance switch. On unless they turned it off.Úin_app_tipsT)Údefault)r   Úuser_enabled© ó    r    Úcheck_tips_enabledr3   H   s   € ä×"Ñ" =¸$Ô?Ð?r2   r   c                 ó`   — t        di dD �ci c]  }|| j                  |d«      “Œ c}¤ŽS c c}w )Nr(   r   r1   )r!   Úget)ÚargsÚkwr   s      r    ú<lambda>r8   O   s2   € œxñ  OØ'LÖ
M !ˆ1ˆd�h‰h�q˜"‹oÑÒ
Mñ O€ ùÚ
Ms   Œ+u   ðŸ’¡)r+   ÚtoolsetÚschemaÚcheck_fnÚhandlerÚemoji)r   r   )Ú__doc__r   Útoolsr   Útools.registryr   r   r   Ústrr!   ÚlistÚ
TIP_SCHEMAÚboolr3   Úregisterr1   r2   r    ú<module>rF      sã   ðñUó
 å ß /à*€ñS�3ð S #ð S¨cð S¸cð SÈ3ó Sð. ð	Lð ð !Ø>ñð
 !Ø<ñð
 !Ø2ñð
 !Ù˜U›ØGññ
ð& ˜ZÐ(ñ+ñ!€
ðH@˜Dó @ð
 €× Ñ Ø	˜\°*ÐGYñOà
ö	r2   